uNetworking / uWebSockets.js

μWebSockets for Node.js back-ends :metal:
Apache License 2.0
7.95k stars 570 forks source link

req.getQuery() is returning undefiend insteated of empty string #1035

Closed sailingwithsandeep closed 2 months ago

sailingwithsandeep commented 6 months ago

as stated in docs it should return empty string

 /** Returns the raw querystring (the part of URL after ? sign) or empty string. */
    getQuery() : string;

Code:

get('/', (res, req) => {
                console.log(req.getQuery());

                res.writeStatus('201 Created').end("It's been real, Cupcake. Thanks. For everything! 🐣");
            })

Am i doing something wrong here?

uNetworkingAB commented 6 months ago

Docs are wrong. Undefined means missing, empty string means present but empty

sailingwithsandeep commented 6 months ago

Can i open PR for refactoring doc?

I am loving this project and implemented in current project as well. Would love to help.

uNetworkingAB commented 2 months ago

I think this was fixed