-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(perm): allow-net with port 80 #21221
Conversation
6151261
to
8cc5952
Compare
I've updated the PR with the following commit:
|
8cc5952
to
ec9ade7
Compare
Looks like when you call |
When setting `allow-net` to a host and port, if the port is 80, then all ports are allowed. During the parsing of the host and port, the scheme was assumed to be `http` which makes the port redundant. In this case, Url::parse assumed `None` for the port, which allowed for all ports. This change-set uses the term `unknown` for the scheme as this has no effect on the parsing of the host and port and ensures that the specified port is used. Finally, when extracting the hsotname, return a `ParseError::EmptyHost` if the host is not specified. This behaviour is consistent with Url::parse when an `http` scheme is set. Fixes denoland#21220
ec9ade7
to
bf08744
Compare
Updated the change-set to explicitly return a |
The tests appear to run locally for me, so we should be able to kick this off again on the infra. Do you want me to rebase this change-set on |
Hey @irbull, sorry for a slow turnaround. Someone will review the PR this week. |
No worries. I'm actually travelling right now. Let me know if you'd like me to rebase this first? |
No need, looks fine 👍 |
The test failures here seem to come from the integration tests for the server and the server not being shut down properly. I saw these too, but others were also suggesting that a transient issue in the tests may have been at play then. I rebased locally and ran the tests again today and I don't see this, although I'm running them on Mac not Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
This change-set adds a test case that demonstrates an issues with
allow-net
. Ifallow-net
specifies a host and port, and the port is 80, then all ports are allowed.This doesn't appear to happen with other well known ports.
This test demonstrates the problem reported in #21220.