GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: mention the behaviour if URL is invalid by thefourtheye · Pull Request #2966 · nodejs/node

Conversation

@thefourtheye

@thefourtheye thefourtheye commented Sep 20, 2015

Copy link
Copy Markdown
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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thefourtheye thefourtheye added http Issues and PRs related to the http subsystem. doc Issues and PRs related to Node.js documentation. labels Sep 20, 2015
@ChALkeR

ChALkeR commented Sep 20, 2015

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye

thefourtheye commented Sep 20, 2015

Copy link
Copy Markdown
Contributor Author

@ChALkeR 👍 for fixing it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Sep 20, 2015

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ChALkeR

ChALkeR commented Sep 20, 2015

Copy link
Copy Markdown
Member

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye thefourtheye mentioned this pull request Sep 20, 2015
http{s}: fix connecting to localhost if URL is invalid #2967
Closed
This was referenced Sep 21, 2015
Release Proposal: v4.1.1 #2943
Closed
Discussion: LTS & v5 release planning #3000
Closed
@targos

targos commented Sep 25, 2015

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye
thefourtheye force-pushed the http-request-doc-improvement branch from b659563 to 281b254 Compare October 4, 2015 16:08
@thefourtheye

thefourtheye commented Oct 4, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye added a commit to thefourtheye/io.js that referenced this pull request Oct 6, 2015
@thefourtheye
http{s}: don't connect to localhost on invalid URL
4897c28
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

thefourtheye commented Oct 25, 2015

Copy link
Copy Markdown
Contributor Author

Bump!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye thefourtheye mentioned this pull request Oct 26, 2015
Release proposal: v5.0.0 #3466
Merged
@thefourtheye

thefourtheye commented Oct 26, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye thefourtheye added the lts-watch-v4.x label Oct 26, 2015
thefourtheye added a commit that referenced this pull request Oct 27, 2015
@thefourtheye
http{s}: don't connect to localhost on invalid URL
437930c
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

jasnell commented Oct 27, 2015

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the relnotes label Oct 27, 2015
@thefourtheye

thefourtheye commented Oct 27, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Oct 27, 2015

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye
doc: mention the behaviour if URL is invalid
4e0904e
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 force-pushed the http-request-doc-improvement branch from 281b254 to 4e0904e Compare October 28, 2015 01:54
@thefourtheye

thefourtheye commented Oct 28, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Oct 28, 2015

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Oct 28, 2015

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye added a commit that referenced this pull request Oct 29, 2015
@thefourtheye
doc: mention the behaviour if URL is invalid
14135f0
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

thefourtheye commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Landed at 14135f0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye thefourtheye closed this Oct 29, 2015
@thefourtheye

thefourtheye commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye added a commit that referenced this pull request Oct 29, 2015
@thefourtheye
doc: mention the behaviour if URL is invalid
282065f
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

thefourtheye commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@thefourtheye @rvagg
http{s}: don't connect to localhost on invalid URL
c9786bb
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]>
@jasnell jasnell mentioned this pull request Oct 29, 2015
Preparing v4.2.2 LTS Maintenance nodejs/Release#50
Closed
thefourtheye added a commit that referenced this pull request Oct 29, 2015
@thefourtheye @jasnell
doc: mention the behaviour if URL is invalid
b422f6e
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]>
@jasnell jasnell added land-on-v4.x and removed lts-watch-v4.x labels Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc Issues and PRs related to Node.js documentation. http Issues and PRs related to the http subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@thefourtheye @ChALkeR @targos @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.