HEAD response without Content-Length gets "Transfer-Encoding: chunked"
@NghiaTranUIT ci sta già lavorando.
Dal 28/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
When a server answers an HTTP/1.1 HEAD request without a Content-Length header (valid, since a HEAD response never has a body), Proxyman forwards the response with an added transfer-encoding: chunked header and then writes the chunked terminator 0\r\n\r\n onto the connection.
A HEAD response must not carry a body (RFC 9110 §9.3.2, RFC 9112 §6.3), so the client correctly reads only the headers and leaves those 5 bytes in the socket. When it reuses the keep-alive connection for its next request, it reads 0\r\n\r\n where the next status line should be and fails. Proxyman shows that next request as 999 Error, and the app reports a network error.
This affects any app using HEAD requests, e.g. Supabase/PostgREST count queries, which supabase-swift and supabase-kt send as HEAD. Whichever request follows the HEAD on the same connection fails randomly, but only while Proxyman is in the path.
Steps to Reproduce
- Use any HTTP/1.1 server whose HEAD response has no
Content-Length. Ours is PostgREST 14.4 behind Kong 2.8.1 (a local Supabase stack on127.0.0.1:54321). - Through the Proxyman proxy (
127.0.0.1:9090), send a HEAD request on a keep-alive connection, e.g. with this raw-socket script (Python 3, no libraries):
import socket
s = socket.create_connection(("127.0.0.1", 9090))
s.sendall((
"HEAD http://127.0.0.1:54321/rest/v1/app_config?select=platform HTTP/1.1\r\n"
"Host: 127.0.0.1:54321\r\n"
"apikey: <anon key>\r\n"
"Authorization: Bearer <anon key>\r\n"
"Prefer: count=exact\r\n"
"Connection: keep-alive\r\n\r\n").encode())
print(s.recv(65536))
- Compare the raw bytes with the same request sent directly to the server (
127.0.0.1:54321, origin-form path). - Send any second request on the same proxied connection. With a real HTTP client (OkHttp/Ktor on Android, URLSession on iOS), that second request fails.
Current Behavior
Through Proxyman, the HEAD response gains a header and a body:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Content-Range: 0-1/2
...
transfer-encoding: chunked <- added by Proxyman
0\r\n\r\n <- added by Proxyman (a body on a HEAD response)
The next request on that connection fails immediately. Proxyman logs it as 999 Error with no response. The client sees a lost connection: Android (OkHttp/Ktor) gets a request failure, and iOS URLSession gets NSURLErrorNetworkConnectionLost (-1005). A retry on a fresh connection succeeds. It reproduces every time.
Expected Behavior
The HEAD response is forwarded exactly as the server sent it. Directly against the server it is:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Content-Range: 0-1/2
...
There is no Transfer-Encoding header and no bytes after the headers, so the next request on the connection works.
Environment
- App version: Proxyman 26.3.0 (build 260300)
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 7.1k
- Fork
- 238
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ProxymanApp/Proxyman
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
ProxymanApp/Proxyman#2821 ·
-
Could not observe system extension changesForse già presa @NghiaTranUIT l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 45/100
ProxymanApp/Proxyman#2819 · 2 commenti · 1 assegnatario ·
-
启动后约 6 秒崩溃Forse già presa @NghiaTranUIT l’ha presa 8 giorni fa. Aperta✅ Done bug
ProxymanApp/Proxyman#2818 · 2 commenti · 1 assegnatario ·
-
[iPadOS] Local VPN toggle does not turn on and VPN profile is not created in iPadOS SettingsForse già presa @NghiaTranUIT l’ha presa 9 giorni fa. Apertabug
ProxymanApp/Proxyman#2817 · 1 commento · 1 assegnatario ·
-
Factory Reset in proxyman-cliForse già presa @NghiaTranUIT l’ha presa 8 giorni fa. Aperta✅ Done enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
ProxymanApp/Proxyman#2816 · 1 commento · 1 assegnatario ·