1
0
Fork 0
mirror of https://github.com/sbrl/powahroot.git synced 2024-12-22 11:15:01 +00:00

RouterContext: Make .querystring portable, update docs

This commit is contained in:
Starbeamrainbowlabs 2024-06-10 13:49:57 +01:00
parent a70d187c98
commit 16067fd010
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -19,7 +19,7 @@ class RouterContext {
*/
get querystring() {
if(this.url.query == null) return {};
return querystring.parse(this.url.query);
return querystring.parse(this.url.search.substring(1));
}
constructor(in_request, in_response) {
@ -35,7 +35,12 @@ class RouterContext {
this.response = in_response;
/**
* The parsed request URL
* @type {URL}
*
* The built-in Node.js `url` module (and NOT the browser-like `URL` class) is used for parsing URLs.
*
* See the `querystring` getter for a portable way to grab the parsed query string.
*
* @type {Url}
*/
this.url = url.parse(this.request.url, true);
/**