uWebSockets.js icon indicating copy to clipboard operation
uWebSockets.js copied to clipboard

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

Open sailingwithsandeep opened this issue 1 year ago • 2 comments

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?

sailingwithsandeep avatar Mar 14 '24 05:03 sailingwithsandeep

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

uNetworkingAB avatar Mar 14 '24 12:03 uNetworkingAB

Can i open PR for refactoring doc?

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

sailingwithsandeep avatar Mar 14 '24 12:03 sailingwithsandeep

I think this was fixed

uNetworkingAB avatar Aug 06 '24 13:08 uNetworkingAB