Trim the newline at the end of raw request file (#438)
This commit is contained in:
parent
25fc4e4b49
commit
33f3ecb65c
@ -3,6 +3,7 @@
|
|||||||
- New
|
- New
|
||||||
- Added a CLI flag to disable the interactive mode
|
- Added a CLI flag to disable the interactive mode
|
||||||
- Changed
|
- 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 an issue with storing the matches for recursion jobs
|
||||||
- Fixed the way the "size" is calculated, it should match content-length now
|
- 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 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)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user