[GH-ISSUE #1645] Response breakpoint closes the connection #1639

Open
opened 2026-03-03 19:53:05 +03:00 by kerem · 2 comments
Owner

Originally created by @af-jul on GitHub (May 22, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1645

Originally assigned to: @NghiaTranUIT on GitHub.

Description

I have the following in my App:

  • I'm doing a request with an Authorization header
  • Whenever the server gives me a 401 then I
    1. Do a token refresh
    2. Retry the original request (with the new token) on the same connection

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
  • request breakpoints alone do not seem to cause the issue, but only response breakpoints do
  • doing a retry-call on the same connection when receiving a 200 and hitting the breakpoint does not seem to cause the issue
  • Adding an explicit Connection: close header in the 401 response after it hit the breakpoint, seems to work but is not my desired solution

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

  • App version: e.g Proxyman 4.7.1 (47010)
  • macOS version: e.g macOS Ventura 13.3.1
Originally created by @af-jul on GitHub (May 22, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1645 Originally assigned to: @NghiaTranUIT on GitHub. ## Description I have the following in my App: - I'm doing a request with an Authorization header - Whenever the server gives me a 401 then I 1. Do a token refresh 2. Retry the original request (with the new token) on the same connection 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 3. Let the server return a 401 and hit the breakpoint 4. Deliver the response back to the app 5. Try to do another request on the same connection --> Fails - request breakpoints alone do not seem to cause the issue, but only response breakpoints do - doing a retry-call on the same connection when receiving a 200 and hitting the breakpoint does not seem to cause the issue - Adding an explicit `Connection: close` header in the 401 response after it hit the breakpoint, seems to work but is not my desired solution ## 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 - App version: e.g Proxyman 4.7.1 (47010) - macOS version: e.g macOS Ventura 13.3.1
Author
Owner

@NghiaTranUIT commented on GitHub (May 23, 2023):

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

<!-- gh-comment-id:1558613830 --> @NghiaTranUIT commented on GitHub (May 23, 2023): @af-jul just wondering: Does this bug only happen with the 401 status code?
Author
Owner

@af-jul commented on GitHub (May 23, 2023):

@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.

<!-- gh-comment-id:1558705610 --> @af-jul commented on GitHub (May 23, 2023): @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1639
No description provided.