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
{{ message }}
Repository navigation
followRedirect re-POSTs on 303/301/302; GET data dropped after a #fragment; form arrays comma-joined #981
When following a 303/301/302 redirect after a POST, urllib re-sends the request as a POST with the original body; also, GET data is dropped when the URL has a #fragment, and array values in default form bodies are comma-joined instead of repeating the key.
Per RFC 9110 §15.4.4 and the Fetch standard, a 303 redirect switches the request to GET without a body (and Fetch/browsers also switch POST to GET on 301/302). #requestInternal instead reuses the original options (method, data, content) for every redirect status instead of keeping the method and body only on 307/308.
In src/HttpClient.ts line 597, the GET query is built as href + (href.includes('?') ? '&' : '?') + query. When the URL has a #fragment, the query string is appended after # and becomes part of the fragment, so it is never sent on the wire.
In src/HttpClient.ts line 618, non-nested form bodies use new URLSearchParams(args.data).toString(), which coerces array values with Array.prototype.toString() ('x,y'), whereas the GET branch uses querystring.stringify(args.data) and repeats the key (b=x&b=y).
Versions: urllib@4.9.1 (latest4.9.0), and master 99741f8f on Node.js v26.13.0.
Activity
fix: follow 303 redirects with GET and append query data before fragm…
fengmk2 commentedon Nov 23, 2026
#1000