h2c
h2c copied to clipboard
--data-binary output should be escaped
Similar to the -F
multipart bugs, the strings after --data-bianry
are not escaped.
Given this input:
POST / HTTP/1.1
Host: localhost:8000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 5
Content-Type: application/x-www-form-urlencoded
$PATH
h2c outputs:
curl --http1.1 --user-agent "curl/7.47.0" --data-binary "$PATH" https://localhost:8000/
A POSIX shell will expand $PATH
.
The same is true for other fields, such as user agent.
Yes, and other headers too.
Binary data (specifically non-printable characters) should also be escaped and written as \x##
.