Closed izonder closed 4 years ago
If make the reproducing code consistent and pass WHATWG-URL
objects as a parameter everywhere, nothing will change:
//reference call with http via TCP/IP port
http.get(
new URL(`http://localhost:${port}/http${search}`),
{headers: {authorization: 'Basic aaa'}},
cb
);
//reference call with got via TCP/IP port
got
.get(new URL(`http://localhost:${port}/got${search}`), {headers: {authorization: 'Basic aaa'}})
.then(cb);
//reference call with http via unix-socket
http.get(
new URL(`http://unix:${socket}:/http${search}`),
{socketPath: '/tmp/app.sock', headers: {authorization: 'Basic aaa'}},
cb
);
//testing call with got via unix-socket
got
.get(new URL(`http://unix:${socket}:/got${search}`), {headers: {authorization: 'Basic aaa'}})
.then(cb);
The output is the same:
$ node ./test.js
call to /tmp/app.sock, URL = /tmp/app.sock:/http?foo=bar
call to /tmp/app.sock, URL = /got
call to 3000, URL = /http?foo=bar
call to 3000, URL = /got?foo=bar
Confirmed for macOS as well:
Node.js version: v12.13.1 OS & version: macOS 10.14.6 (Darwin 18.7.0) Got: v10.2.2
Also noticed this. This is a regression, v9.6.0 does work.
Is there any workaround for this?
Describe the bug
Actual behavior
Making a call via UNIX-socket results in not passing query string in URL. When making a call via normal TCP/IP port it works correctly. For example, for the code below we have received the output:
Expected behavior
Having query string in request in both cases. For example, for the code below it's expected the output:
or at least:
Code to reproduce
Checklist