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

Support scheme-less urls if "https" is allowed (#662) #669

Merged
merged 1 commit into from Jun 3, 2022
Merged

Support scheme-less urls if "https" is allowed (#662) #669

merged 1 commit into from Jun 3, 2022

Conversation

willkg
Copy link
Member

@willkg willkg commented Jun 2, 2022

Previously, we allowed scheme-less urls if "http" was allowed. This
expands that to also support "https".

Fixes #662

Previously, we allowed scheme-less urls if "http" was allowed. This
expands that to also support "https".
@willkg willkg requested a review from g-k June 2, 2022 14:17
'<a href="/path">valid</a>',
{"protocols": ["https"]},
'<a href="/path">valid</a>',
),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this one, but not the others figuring if this one works, they all work.

if "http" in allowed_protocols:
# If there's no protocol/scheme specified, then assume it's "http" or
# "https" and see if that's allowed
if "http" in allowed_protocols or "https" in allowed_protocols:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the minimal change to fix the bug. I do think the things we talked about are interesting as well, but I think I want to push them off so as to get 5.0.1 out the door.

Copy link
Collaborator

@g-k g-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ lgtm

@willkg willkg merged commit 5d4725c into mozilla:main Jun 3, 2022
@willkg
Copy link
Member Author

willkg commented Jun 3, 2022

Thank you!

@willkg willkg deleted the 662-url branch June 3, 2022 12:45
@willkg willkg added this to the v5.0.1 milestone Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Relative url is removed when the allowed protocol is https
2 participants