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

doc: mention the behaviour if URL is invalid #2966

Closed

Conversation

thefourtheye
Copy link
Contributor

If the URL passed to http.request is not properly parsable by url.parse, we
fall back to use localhost and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.

@thefourtheye thefourtheye added http Issues or PRs related to the http subsystem. doc Issues and PRs related to the documentations. labels Sep 20, 2015
@ChALkeR
Copy link
Member

ChALkeR commented Sep 20, 2015

If the URL passed to http.request is not properly parsable by url.parse, we fall back to use localhost and port 80.

What?? Are you telling me that if something listens on localhost:80, then all invalid urls will retrieve that? This should be fixed, imo. If URL is not parsable, it should produce an error regardless of something listening localhost:80 or not.

@thefourtheye
Copy link
Contributor Author

@ChALkeR 👍 for fixing it.

@targos
Copy link
Member

targos commented Sep 20, 2015

+1 for fixing http.request but it would be semver-major so this PR is still relevant for v4.x.

@ChALkeR
Copy link
Member

ChALkeR commented Sep 20, 2015

@targos Documenting it is the opposite to fixing it. I treat this as a bug, the behavior is completely unexpected.

Everything except for the **Note** part looks reasonable, though. Do not treat this as LGTM, I am not a native English speaker.

@targos
Copy link
Member

targos commented Sep 25, 2015

If #2967 only goes on master, we can land this change on without the note and add the note in v4.x with a separate PR

@thefourtheye
Copy link
Contributor Author

@ChALkeR I updater the PR as per your comment here #2967 (comment). PTAL.

thefourtheye added a commit to thefourtheye/io.js that referenced this pull request Oct 6, 2015
If the URL passed to `http{s}.request` or `http{s}.get` is not properly
parsable by `url.parse`, we fall back to use `localhost` and port 80.
This creates confusing error messages like in this question
http://stackoverflow.com/q/32675907/1903116.

This patch throws an error message, if `url.parse` fails to parse the
URL properly.

Previous Discussion: nodejs#2966
PR-URL: nodejs#2967
@thefourtheye
Copy link
Contributor Author

Bump!

@thefourtheye
Copy link
Contributor Author

Okay tagging this as lts-watch as this would be important to have in a LTS release. cc @nodejs/tsc

thefourtheye added a commit that referenced this pull request Oct 27, 2015
If the URL passed to `http{s}.request` or `http{s}.get` is not properly
parsable by `url.parse`, we fall back to use `localhost` and port 80.
This creates confusing error messages like in this question
http://stackoverflow.com/q/32675907/1903116.

This patch throws an error message, if `url.parse` fails to parse the
URL properly.

Previous Discussion: #2966
PR-URL: #2967

Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 27, 2015

Recommend landing this documentation change in v4.x (via v4.x-staging) and documenting the bug in the known issues in the release

@thefourtheye
Copy link
Contributor Author

@jasnell Cool. Do the changes look fine to you?

@jasnell
Copy link
Member

jasnell commented Oct 27, 2015

The specific edits that I see here, yes, but I notice that the documentation updates do not mention the errant fallback behavior. I'm wondering if we shouldn't go ahead and add it to the docs but couch it in language like "Currently..." and "this will be fixed soon", that sort of thing.

If the URL passed to `http.request` is not properly parsable by `url.parse`, we
fall back to use `localhost` and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.
@thefourtheye
Copy link
Contributor Author

@jasnell Okay, I included "This will be fixed soon" in the Notes section. Is that what you meant?

@jasnell
Copy link
Member

jasnell commented Oct 28, 2015

@thefourtheye ... yep, that works. I would also list this in the known issues section in the release notes

@jasnell
Copy link
Member

jasnell commented Oct 28, 2015

LGTM

thefourtheye added a commit that referenced this pull request Oct 29, 2015
If the URL passed to `http.request` is not properly parsable by `url.parse`, we
fall back to use `localhost` and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.

PR-URL: #2966

Reviewed-By: James M Snell <[email protected]>
@thefourtheye
Copy link
Contributor Author

Thanks for the review. Landed at 14135f0

@thefourtheye
Copy link
Contributor Author

Sorry. This change was not supposed to go to master. Force pushing.

thefourtheye added a commit that referenced this pull request Oct 29, 2015
If the URL passed to `http.request` is not properly parsable by `url.parse`, we
fall back to use `localhost` and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.

PR-URL: #2966
Reviewed-By: James M Snell <[email protected]>
@thefourtheye
Copy link
Contributor Author

Okay, landed the change in v4.x-staging at 282065f

@thefourtheye thefourtheye deleted the http-request-doc-improvement branch October 29, 2015 03:04
rvagg pushed a commit to rvagg/io.js that referenced this pull request Oct 29, 2015
If the URL passed to `http{s}.request` or `http{s}.get` is not properly
parsable by `url.parse`, we fall back to use `localhost` and port 80.
This creates confusing error messages like in this question
http://stackoverflow.com/q/32675907/1903116.

This patch throws an error message, if `url.parse` fails to parse the
URL properly.

Previous Discussion: nodejs#2966
PR-URL: nodejs#2967

Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
thefourtheye added a commit that referenced this pull request Oct 29, 2015
If the URL passed to `http.request` is not properly parsable by `url.parse`, we
fall back to use `localhost` and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.

PR-URL: #2966
Reviewed-By: James M Snell <[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. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants