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

fix: return 400 if uri is bad #69

Merged
merged 2 commits into from
Mar 15, 2024
Merged

fix: return 400 if uri is bad #69

merged 2 commits into from
Mar 15, 2024

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Mar 15, 2024

I still think it could be possible to redirect these, but ultimately a bad uri is a sign that something weird is going on that is probably an edge case so it should be perfectly fine to just return a 400.

Resolves #68
Closes #64

begin
return redirect.response unless redirect.canonical?
rescue Addressable::URI::InvalidURIError
return [400, { Rack::CONTENT_TYPE => "text/plain", Rack::CONTENT_LENGTH => "0" }, []]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tylerhunt tylerhunt merged commit 9752e9d into tylerhunt:master Mar 15, 2024
25 of 30 checks passed
@G-Rath G-Rath deleted the handle-invalid-urls branch March 15, 2024 16:02
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.

Handle invalid URIs
2 participants