diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c39af6..60e70297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - New - Added a CLI flag to disable the interactive mode - Changed + - Do not read the last newline in the end of the raw request file when using -request - Fixed an issue with storing the matches for recursion jobs - 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 diff --git a/pkg/ffuf/optionsparser.go b/pkg/ffuf/optionsparser.go index c6034130..e04aa485 100644 --- a/pkg/ffuf/optionsparser.go +++ b/pkg/ffuf/optionsparser.go @@ -489,6 +489,12 @@ func parseRawRequest(parseOpts *ConfigOptions, conf *Config) error { } conf.Data = string(b) + // Remove newline (typically added by the editor) at the end of the file + if strings.HasSuffix(conf.Data, "\r\n") { + conf.Data = conf.Data[:len(conf.Data)-2] + } else if strings.HasSuffix(conf.Data, "\n") { + conf.Data = conf.Data[:len(conf.Data)-1] + } return nil }