1
0
Fork 0
mirror of https://github.com/sbrl/powahroot.git synced 2024-11-22 06:23:02 +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() { get querystring() {
if(this.url.query == null) return {}; 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) { constructor(in_request, in_response) {
@ -35,7 +35,12 @@ class RouterContext {
this.response = in_response; this.response = in_response;
/** /**
* The parsed request URL * 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); this.url = url.parse(this.request.url, true);
/** /**