Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: state decoding behavior for url pathname #1731

Closed
wants to merge 2 commits into from
Closed

docs: state decoding behavior for url pathname #1731

wants to merge 2 commits into from

Conversation

joshgummersall
Copy link

Explicitly states the fact that no decoding is performed on the url
path or pathname or the query string by default in the URL module.

@Fishrock123 should I also include a similar change in the Http.Server IncomingMessages documentation as mentioned in the issue?

Fixes #1538

Explicitly states the fact that no decoding is performed on the url
path or pathname or the query string by default in the URL module.

Fixes #1538
@mscdex mscdex added the doc Issues and PRs related to the documentations. label May 19, 2015
@silverwind silverwind added the url Issues and PRs related to the legacy built-in url module. label May 19, 2015
@@ -72,7 +73,8 @@ Take a URL string, and return an object.
Pass `true` as the second argument to also parse the query string using the
`querystring` module. If `true` then the `query` property will always be
assigned an object, and the `search` property will always be a (possibly
empty) string. Defaults to `false`.
empty) string. If `false` then the neither the `query` nor the `search`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the superfluous 'the ' before 'neither'.

@silverwind
Copy link
Contributor

Looking good, except the typo. I think it's unnecessary to add it to http too.

@@ -72,7 +73,8 @@ Take a URL string, and return an object.
Pass `true` as the second argument to also parse the query string using the
`querystring` module. If `true` then the `query` property will always be
assigned an object, and the `search` property will always be a (possibly
empty) string. Defaults to `false`.
empty) string. If `false` then the neither the `query` nor the `search`
properties will be parsed or decoded. Defaults to `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking at the code I'm not really sure search is parsed at all?

Not too familiar with url code though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, it looks like only query is decoded:

> url.parse('http://foo.com/?%26', true).search
'?%26'
> url.parse('http://foo.com/?%26', true).query
{ '&': '' }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, query is the decoded from the search field.

@joshgummersall
Copy link
Author

@silverwind removed the search piece and fixed the grammar of the docs. Will not add anything to the http documentation.

silverwind pushed a commit that referenced this pull request May 25, 2015
Explicitly states the fact that no decoding is performed on the url
path or pathname or the query string by default in the URL module.

Fixes: #1538
PR-URL: #1731
Reviewed-By: Roman Reiss <[email protected]>
@silverwind
Copy link
Contributor

Thanks, landed in a74c2c9

@silverwind silverwind closed this May 25, 2015
@joshgummersall joshgummersall deleted the fix-url-parsing-docs branch May 25, 2015 21:17
This was referenced May 27, 2015
andrewdeandrade pushed a commit to andrewdeandrade/node that referenced this pull request Jun 3, 2015
Explicitly states the fact that no decoding is performed on the url
path or pathname or the query string by default in the URL module.

Fixes: nodejs/node#1538
PR-URL: nodejs/node#1731
Reviewed-By: Roman Reiss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: state behavior for url pathname and percent encoding
4 participants