Reproducer for gr3p1p3/transparent-proxy#21
- run
yarn
- run
node index.js
- run
curl --proxy localhost:8888 --insecure --proxy-insecure -F "foo=bar" -F"baz=qux" https:/httpbin.org/anything
form another shell - verify the result contains the form fields
foo
andbaz
and their values - Comment
index.js:L34
and un-commentindex.js:L38
- restart the server
- run the curl command again
working: no async header - response
$ curl --proxy localhost:8888 --insecure --proxy-insecure -F "foo=bar" -F"baz=qux" https:/httpbin.org/anything
{
"args": {},
"data": "",
"files": {},
"form": {
"baz": "qux",
"foo": "bar"
},
"headers": {
"Accept": "*/*",
"Content-Length": "236",
"Content-Type": "multipart/form-data; boundary=------------------------49e0ef59d2018523",
"Host": "httpbin.org",
"User-Agent": "curl/7.82.0",
"X-Amzn-Trace-Id": "Root=1-63cea77b-1665e9b06bda113b3049b28d",
"X-Test": "sync"
},
"json": null,
"method": "POST",
"origin": "178.27.174.62",
"url": "https://httpbin.org/anything"
}
working: no asnyc header - server log
Proxy started
### 2023-01-23T15:27:55.297Z 127.0.0.1:51635 => { ADDRESS: 'httpbin.org', PORT: 443 }
[
'POST /anything HTTP/1.1',
'Host: httpbin.org',
'User-Agent: curl/7.82.0',
'Accept: */*',
'Content-Length: 236',
'Content-Type: multipart/form-data; boundary=------------------------49e0ef59d2018523',
'x-test: sync',
'',
''
]
[
'--------------------------49e0ef59d2018523',
'Content-Disposition: form-data; name="foo"',
'',
'bar',
'--------------------------49e0ef59d2018523',
'Content-Disposition: form-data; name="baz"',
'',
'qux',
'--------------------------49e0ef59d2018523--',
''
]
broken: async header - response
$ curl --proxy localhost:8888 --insecure --proxy-insecure -F "foo=bar" -F"baz=qux" https:/httpbin.org/anything
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
</body>
</html>
broken: async header - server log
node index.js
Proxy started
### 2023-01-23T15:30:51.834Z 127.0.0.1:51673 => { ADDRESS: 'httpbin.org', PORT: 443 }
[
'--------------------------d05fcb0e05557989',
'Content-Disposition: form-data; name="foo"',
'',
'bar',
'--------------------------d05fcb0e05557989',
'Content-Disposition: form-data; name="baz"',
'',
'qux',
'--------------------------d05fcb0e05557989--',
''
]
[
'POST /anything HTTP/1.1',
'Host: httpbin.org',
'User-Agent: curl/7.82.0',
'Accept: */*',
'Content-Length: 236',
'Content-Type: multipart/form-data; boundary=------------------------d05fcb0e05557989',
'x-test: added async',
'',
''
]
Seems to be fixed as of
v1.11.7
. 🙌 , thanks @gr3p1p3!