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

bug-1902001: fix source highlight with bad urls #6783

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

willkg
Copy link
Contributor

@willkg willkg commented Nov 2, 2024

If the url provided isn't a valid url, treat it as if the document doesn't exist and return an HTTP 404.

To test:

> curl "http://localhost:8000/sources/highlight/?url=https://crash-stats.allizom.org\[@a.xxx.org/?"

Compare that with:

> curl "https://crash-stats.allizom.org/sources/highlight/?url=https://crash-stats.allizom.org\[@a.xxx.org/?"

(You need the \[ because otherwise curl thinks the [ means something and kicks up curl: (3) bad range specification in URL position 78:.)

If the url provided isn't a valid url, treat it as if the document
doesn't exist and return an HTTP 404.
@willkg willkg requested a review from a team as a code owner November 2, 2024 01:15
@willkg willkg added this pull request to the merge queue Nov 2, 2024
@willkg
Copy link
Contributor Author

willkg commented Nov 2, 2024

Thank you!

Merged via the queue into main with commit 9384ecc Nov 2, 2024
1 check passed
@willkg willkg deleted the willkg-bug-1902001-highlight branch November 2, 2024 12:34
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.

2 participants