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

Update examples in “URL: port” doc #28238

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Conversation

raro42
Copy link
Contributor

@raro42 raro42 commented Jul 28, 2023

Allthough specified, the port property returns empty string on https + 443 port, http + 80 port.

Description

Adding two examples where port property returns empty string, allthough it was specified in the construct.

Motivation

Adding the examples, as it is unclear to me, if this is working as designed or a feature. Anyhow it might lead hard to discover bugs, if we rely on the port property being filled properly.

I hope that the examples will help developers to prevent bugs.

Additional details

Related issues and pull requests

@raro42 raro42 requested a review from a team as a code owner July 28, 2023 08:19
@raro42 raro42 requested review from wbamberg and removed request for a team July 28, 2023 08:19
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jul 28, 2023
@raro42
Copy link
Contributor Author

raro42 commented Jul 28, 2023

leaving here the change for your convinience

Port 80 + 443 in combination with http + https show empty port

new URL("https://example.com:443/svn/Repos/").port; // shows ''
new URL("http://example.com:80/svn/Repos/").port; // shows ''

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

Preview URLs

(comment last updated: 2023-07-28 09:32:38)

@sideshowbarker sideshowbarker changed the title Update index.md with URL example where port property returns empty Update examples in “URL: port” doc Jul 28, 2023
@sideshowbarker sideshowbarker merged commit 6359ece into mdn:main Jul 28, 2023
6 checks passed
@raro42
Copy link
Contributor Author

raro42 commented Jul 28, 2023

1.) There is a small typo in : nubmer ... should read: number. In update from @sideshowbarker

2.) new URL('sftp://foo.bar:21/').port also returns empty string.

@sideshowbarker
Copy link
Collaborator

1.) There is a small typo in : nubmer ... should read: number. In update from @sideshowbarker

2.) new URL('sftp://foo.bar:21/').port also returns empty string.

If you’d be willing to put together a follow-up PR with those changes, I could review it and merge it

@raro42 raro42 deleted the patch-1 branch July 28, 2023 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants