curl
curl bug?
$ curl https://example.org -H $'Forwarded: host="foo\nbar"'
curl: (43) A libcurl function was given a bad argument
# http:// works
# No $ works
# No \n works
It happens with HTTP/2. Against HTTP/1.1 hosts (like herokuapp.com), the request never completes. curl will give up after 1 min with curl: (52) Empty reply from server. The following repeats, from curl -vvvv https://app.herokuapp.com/ -H $'X-Forwarded-Host: foo\nbar.baz'.
...
005c: X-Forwarded-Host: foo.bar.baz
007b:
15:34:01.605935 [0-0] == Info: [TCP] recv(len=5) -> -1, err=81
15:34:01.606018 [0-0] == Info: [SSL] ossl_bio_cf_in_read(len=5) -> -1, err=81
15:34:01.606114 [0-0] == Info: [SSL] cf_recv(len=102400) -> -1, 81
15:34:01.606250 [0-0] == Info: Request completely sent off
15:34:02.607461 [0-0] == Info: [TCP] recv(len=5) -> -1, err=81
15:34:02.607566 [0-0] == Info: [SSL] ossl_bio_cf_in_read(len=5) -> -1, err=81
15:34:02.607642 [0-0] == Info: [SSL] cf_recv(len=102400) -> -1, 81
...