Fix header canonicalization (#435)

This commit is contained in:
Joona Hoikkala 2021-04-26 22:48:44 +03:00 committed by GitHub
parent d6b273332b
commit aaa8f31865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@
- New
- Changed
- Fixed the way the "size" is calculated, it should match content-length now
- Fixed an issue with header canonicalization when a keyword was just a part of the header name
- Fixed output writing so it doesn't silently fail if it needs to create directories recursively
- v1.3.0

View file

@ -255,14 +255,14 @@ func ConfigFromOptions(parseOpts *ConfigOptions, ctx context.Context, cancel con
// except if used in custom defined header
var CanonicalNeeded = true
for _, a := range conf.CommandKeywords {
if a == hs[0] {
if strings.Contains(hs[0], a) {
CanonicalNeeded = false
}
}
// check if part of InputProviders
if CanonicalNeeded {
for _, b := range conf.InputProviders {
if b.Keyword == hs[0] {
if strings.Contains(hs[0], b.Keyword) {
CanonicalNeeded = false
}
}