mirror of
https://github.com/ffuf/ffuf
synced 2024-11-10 06:04:17 +00:00
Trim the newline at the end of raw request file (#438)
This commit is contained in:
parent
25fc4e4b49
commit
33f3ecb65c
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue