Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update "urlParse" params. #3581

Closed
wants to merge 2 commits into from

5 participants

@Math-

Add "option" param to "urlParse" for "querystring.parse".

@invalid-email-address invalid-email-address Update "urlParse" params.
Add "option" param to "urlParse" for "querystring.parse".
c4313dd
@bnoordhuis
Owner

I'm going to push back on feature creep in v0.9 so my first question is: why do you need this? :-)

@Math-

To have the ability to limit the number of querystring parameters that are parsed, that's why "option" parameter has been added to "querystring.parse" in node-v0.8.0.

Users should have access to the "option" parameter of "querystring.parse" use in "urlParse", it can be useful for limiting the number of "GET" variables to parse from "request.url" (default value of "option.maxKeys" is 1000 and users should have the ability to increase or decrease this value).

@Math- Math- Update "log" function.
Add support to customize "timestamp" format and value.
fa583b9
@bnoordhuis
Owner

@isaacs You should review this.

@Nodejs-Jenkins

Can one of the admins verify this patch?

@tjfontaine

I'm going to close this, if you'd like to see this feature a new PR would be great. Thanks

@tjfontaine tjfontaine closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 28, 2012
  1. @invalid-email-address

    Update "urlParse" params.

    invalid-email-address authored
    Add "option" param to "urlParse" for "querystring.parse".
Commits on Jun 29, 2012
  1. @Math-

    Update "log" function.

    Math- authored
    Add support to customize "timestamp" format and value.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/url.js
  2. +2 −2 lib/util.js
View
4 lib/url.js
@@ -89,7 +89,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i,
},
querystring = require('querystring');
-function urlParse(url, parseQueryString, slashesDenoteHost) {
+function urlParse(url, parseQueryString, slashesDenoteHost, options) {
if (url && typeof(url) === 'object' && url.href) return url;
if (typeof url !== 'string') {
@@ -286,7 +286,7 @@ function urlParse(url, parseQueryString, slashesDenoteHost) {
out.search = rest.substr(qm);
out.query = rest.substr(qm + 1);
if (parseQueryString) {
- out.query = querystring.parse(out.query);
+ out.query = querystring.parse(out.query, null, null, options);
}
rest = rest.slice(0, qm);
} else if (parseQueryString) {
View
4 lib/util.js
@@ -457,8 +457,8 @@ function timestamp() {
}
-exports.log = function(msg) {
- exports.puts(timestamp() + ' - ' + msg.toString());
+exports.log = function(msg, timestampValue) {
+ exports.puts(typeof timestampValue != "undefined" ? timestampValue.toString() : timestamp() + ' - ' + msg.toString());
};
Something went wrong with that request. Please try again.