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
This line tries to set the host option in a call to http.request to the hostname from the requested URL, but URL.hostname includes [] wrapping, and http.request's host fails when this is provided:
newURL('http://[::1]:8080').hostname// [::1]http.request({port: 8080,host: '[::1]'})// failshttp.request({port: 8080,host: '::1'})// fine
I would list this as a feature request rather than a bug, but it's clear from nearby code that IPv6 is intended to be supported already.
Code to reproduce
This was originally reported to me here davidje13/superwstest#18 and narrowed down to when supertest is invoked with an IPv6 URL. A minimal reproduction using only superagent:
Describe the bug
Node.js version: 23.4.0
OS version: Ubuntu 24.10 / Mac OS 15.3
Description:
This line tries to set the
host
option in a call tohttp.request
to thehostname
from the requested URL, butURL.hostname
includes[]
wrapping, andhttp.request
'shost
fails when this is provided:I would list this as a feature request rather than a bug, but it's clear from nearby code that IPv6 is intended to be supported already.
Code to reproduce
This was originally reported to me here davidje13/superwstest#18 and narrowed down to when supertest is invoked with an IPv6 URL. A minimal reproduction using only superagent:
Actual behavior
Expected behavior
Successful request to server
Checklist
The text was updated successfully, but these errors were encountered: