ProxymanApp / ProxymanApp/Proxyman

Scripting Tool turning 304 responses into 200 with non-empty body

Open
#1,880 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

When using the Scripting Tool to forward requests to a local server, the request with status code 304 before forwarding will become 200, with a strange non-empty body, causing the browser failed to execute javascript code.

Steps to Reproduce

  1. Start a local http dev server.
  2. Enable system proxy in Proxyman (or using SwitchyOmega in a browser).
  3. Use Scripting Tool to redirect http requests (from https://example.com to http://localhost:8080).
  4. If local dev server returns 304 Not Modified, the browser may receives 200 OK with a strange body:
0

HTTP/1.1 304 Not Modified
Access-Control-Allow-Origin: *
Content-Type: application/javascript; charset=utf-8
Accept-Ranges: bytes
ETag: W/"182a1-eQ3lKViLjXY/D1cwx5lSaWKT2Io"
Content-Encoding: gzip
Date: Thu, 14 Dec 2023 07:05:26 GMT
Connection: keep-alive
Keep-Alive: timeout=5
transfer-encoding: chunked

0

Current Behavior

Response header received in Chrome (should be 304 Not Modified):

Screen Capture 2023-12-14 at 15 13 42

Response body received in Chrome (should be empty):

Screen Capture 2023-12-14 at 15 14 52

Corresponding request in Proxyman:

Screen Capture 2023-12-14 at 15 15 28

Script using in Proxyman:

Screen Capture 2023-12-14 at 15 16 17

Expected Behavior

Chrome received 304 Not Modified with an empty body, just as before it was forwarded.

Environment

  • App version: Proxyman 4.14.0 (49500)
  • macOS version: macOS Sonoma

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Scripting Tool request-forwarding path and reproduce the issue using a local HTTP server that returns 304 Not Modified, following the listed proxy and redirect steps. Trace how the forwarded response status, headers, chunked transfer, and body are handled; done means Chrome receives a 304 response with an empty body.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.