mirror of
https://github.com/sbrl/powahroot.git
synced 2024-11-21 22:22:59 +00:00
RouterContext: Make .querystring portable, update docs
This commit is contained in:
parent
a70d187c98
commit
16067fd010
1 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue