Skip to content

v3 incorrectly strips out GET params [?] #749

@dzek69

Description

@dzek69

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions