diff options
Diffstat (limited to 'tests/unit_node/http_test.ts')
-rw-r--r-- | tests/unit_node/http_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index c0514eebd..ec20ec7d7 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -1539,3 +1539,21 @@ Deno.test("[node/http] ClientRequest PUT subarray", async () => { await promise; assertEquals(body, "world"); }); + +Deno.test("[node/http] req.url equals pathname + search", async () => { + const { promise, resolve } = Promise.withResolvers<void>(); + + const server = http.createServer((req, res) => res.end(req.url)); + server.listen(async () => { + const { port } = server.address() as net.AddressInfo; + const res = await fetch(`http://localhost:${port}/foo/bar?baz=1`); + const text = await res.text(); + assertEquals(text, "/foo/bar?baz=1"); + + server.close(() => { + resolve(); + }); + }); + + await promise; +}); |