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

Allow matching urls w/ default port and path #978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

henrahmagix
Copy link

Fix #977

@bblimke
Copy link
Owner

bblimke commented Aug 2, 2022

hi @henrahmagix

Thank you for the PR.

It would be good to add a spec to handle that scenario.

While there is no spec for that, I believe this change can break some integrations.

E.g. someone sets allowed "http://example.com" and the request URI is "http://example.com:80/foobar"

The existing code will match and allow network connection but with the introduced change,
it now expects allowed pattern to include the path as well, therefore if this solution was to handle paths,
it would require an additional condition, rather than replacing the current one.

btw. the allowed pattern was created for just scheme host and port, since only these
are used for the actual connection. The path is only used for the HTTP requests
after the connection has already been made.
Though in most cases, we know the URL at the time of making the request
and creating the connection, therefore I think this is acceptable to allow including path
in allowed patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants