You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using hurlfmt with the option --in curl, if the input file contains any illegal headers, the program would simply panic.
hurlfmt, when executed with --in curl, does not check the validity of headers before converting curl commands into the hurl file format. Illegal headers can make their way into the hurl file, and then cause issues with the parser hurl_core::parser::parse_hurl_file.
It's also worth mentioning that, with curl, illegal headers don't seem to result in a crash, nor does curl display any error messages. It simply ignores the header.
Steps to reproduce
Prepare a file with a curl command which contains an illegal header. For example:
thread 'main' panicked at packages/hurl_core/src/error/mod.rs:228:38:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Possible fixes
Add a safeguard in hurlfmt to check curl headers before conversion.
Handle this error in the parser. Display a proper error message if the header is illegal.
The text was updated successfully, but these errors were encountered:
What is the current bug behavior?
When using
hurlfmt
with the option--in curl
, if the input file contains any illegal headers, the program would simply panic.hurlfmt
, when executed with--in curl
, does not check the validity of headers before converting curl commands into the hurl file format. Illegal headers can make their way into the hurl file, and then cause issues with the parserhurl_core::parser::parse_hurl_file
.It's also worth mentioning that, with
curl
, illegal headers don't seem to result in a crash, nor doescurl
display any error messages. It simply ignores the header.Steps to reproduce
hurlfmt
:Possible fixes
hurlfmt
to check curl headers before conversion.The text was updated successfully, but these errors were encountered: