ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.49k stars 180 forks source link

Response breakpoint closes the connection #1645

Open af-jul opened 1 year ago

af-jul commented 1 year ago

Description

I have the following in my App:

If I don't specify any breakpoints in Proxyman everything works well, but as soon as I enable response breakpoints and deliver the 401 to my App, my retry call that uses the same connection as the original request fails with a java.net.ProtocolException: Unexpected status line: 0 while establishing the connection. So it appears that this connection has silently be closed.

Steps to Reproduce

  1. Enable response breakpoints
  2. Let the server return a 401 and hit the breakpoint
  3. Deliver the response back to the app
  4. Try to do another request on the same connection --> Fails

Current Behavior

Proxyman seems to silently close the connection when receiving a 401 response from the server and delivering it back to my App. Further requests on the same connection fail, with such a breakpoint in between, while it is working when I disable the breakpoints.

Expected Behavior

The connection should be kept open / mirror the server state.

Environment

NghiaTranUIT commented 1 year ago

@af-jul just wondering: Does this bug only happen with the 401 status code?

af-jul commented 1 year ago

@NghiaTranUIT that's actually hard to test. It seems like the issue only occurs if the server already responds with this status code and not if I modify the code when the response hit the breakpoint. I was at least able to get the same issue on 404 (that's easy to get from the server) but I'm not sure about other status codes.