From dc1d1f6a147e79fd1da99c8c7d9e2708257749e1 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Mon, 26 Apr 2021 22:46:30 +0300 Subject: [PATCH] Fix header canonicalization --- CHANGELOG.md | 1 + pkg/ffuf/optionsparser.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46457ce6..4bf6cc10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/ffuf/optionsparser.go b/pkg/ffuf/optionsparser.go index 7f73af8a..562c1e81 100644 --- a/pkg/ffuf/optionsparser.go +++ b/pkg/ffuf/optionsparser.go @@ -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 } }