-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
v3 incorrectly strips out GET params [?] #749
Copy link
Copy link
Closed
Labels
Description
Example code, use Node 13.2+:
index.mjs
import express from "express";
import f from "node-fetch";
const fetch = f.default; // Native ESM
const app = express();
app.get("*", (req, res) => {
console.log("srv", req.url)
res.send("yo");
});
app.listen(5001);
(async () => {
const res = await fetch("http://127.0.0.1:5001/api/getStuff?a=tra").then(r => r.text())
console.log(res);
})().catch(e => {
console.error(e);
});With 3.0.0-beta.4 version of node-fetch you'll see just srv /api/getStuff in the console
With 2.6.0 you will see srv /api/getStuff?a=tra - as expected
So it looks like somehow GET query params gets stripped out.
Reactions are currently unavailable