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
Fix NewResponse writing HTTP/0.0 status lines in MITM mode (#749)
* Set HTTP/1.1 proto version in NewResponse
NewResponse left ProtoMajor/ProtoMinor at zero, which produced
HTTP/0.0 status lines when written via resp.Write() in the MITM path
(introduced in #734). Clients like npm reset the connection on seeing
HTTP/0.0, causing repeated 'Cannot read request from mitm'd client'
errors.
Set Proto, ProtoMajor, and ProtoMinor to HTTP/1.1 so resp.Write()
emits a valid status line.
Fixes#745
* Fix linter issues
---------
Co-authored-by: Erik Pellizzon <erikpelli@tutamail.com>
Fix http request handling (#642)
* Avoid to call filterResponse twice for the same request
* Let the client close the connection when it specifies the Connection: close header
* Remove explicit set of Close to false, since it's unnecessary
Cancel MITM request context when its handling finishes (#634)
* Cancel HTTP MITM request context when we have finished with the request processing
* Cancel HTTPS MITM request context when we have finished with the request processing
* Save most recent request in proxy context