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
Description:
As we can see from line 728 of src/node/index.js superagent expects a unix socket address like /path/to/socket.sock to be formatted as %2Fpath%2Fto%2Fsocket.sock, to then separate the socket path from the actual url with a regular expression.
If the unix path is not formatted as required, an unclear error will be thrown: Cannot read properties of null (reading '1')
which is caused by the regexr not being able to match the unix socket path.
Code to reproduce
awaitsuperagent.get('http+unix:///path/to/socket.sock/the/actual/url');// will throw: Cannot read properties of null (reading '1')
It would be much easier to just skip this whole pattern matching and provide and option to directly pass the socket path.
Describe the bug
Node.js version:
18.15.0
OS version:
Ubuntu 20.4
Superagent version:
8.0.9
Description:
As we can see from line 728 of src/node/index.js superagent expects a unix socket address like
/path/to/socket.sock
to be formatted as%2Fpath%2Fto%2Fsocket.sock
, to then separate the socket path from the actual url with a regular expression.If the unix path is not formatted as required, an unclear error will be thrown:
Cannot read properties of null (reading '1')
which is caused by the regexr not being able to match the unix socket path.
Code to reproduce
It would be much easier to just skip this whole pattern matching and provide and option to directly pass the socket path.
Checklist
The text was updated successfully, but these errors were encountered: