diff options
-rw-r--r-- | src/bun.js/http.exports.js | 2 | ||||
-rw-r--r-- | test/bun.js/node-http.test.ts | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bun.js/http.exports.js b/src/bun.js/http.exports.js index d21f768d4..579991424 100644 --- a/src/bun.js/http.exports.js +++ b/src/bun.js/http.exports.js @@ -348,7 +348,7 @@ export class IncomingMessage extends Readable { this.#bodyStream = null; this.#fakeSocket = undefined; - this.url = url.pathname; + this.url = url.pathname + url.search; assignHeaders(this, req); } diff --git a/test/bun.js/node-http.test.ts b/test/bun.js/node-http.test.ts index 7818fba62..6ba619c3e 100644 --- a/test/bun.js/node-http.test.ts +++ b/test/bun.js/node-http.test.ts @@ -6,12 +6,13 @@ describe("node:http", () => { describe("createServer", async () => { it("hello world", async () => { const server = createServer((req, res) => { + expect(req.url).toBe("/hello?world"); res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello World"); }); server.listen(8123); - const res = await fetch("http://localhost:8123"); + const res = await fetch("http://localhost:8123/hello?world"); expect(await res.text()).toBe("Hello World"); server.close(); }); |