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 invalid profile website URI causing a 500 error page on invalid URIs #1188

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

Oaphi
Copy link
Member

@Oaphi Oaphi commented Aug 23, 2023

This is a minor PR fixing #1169 by adding a validate_profile_website method to the users controller. The core of the issue is an unguarded attempt to parse the provided URI with URI.parse, which throws a URI::InvalidURIError on invalid URIs. Here is a preview that everything seems to be working as expected now:

Screencast.from.23.08.2023.13.31.38.webm

I opted to remove the URI from the parameters and notify the user as I believe this is not severe enough to cause other valid changes to fail.

@Oaphi Oaphi added area: ruby Changes to server-side code type: bug Something isn't working labels Aug 23, 2023
@Oaphi Oaphi requested a review from trichoplax August 23, 2023 10:36
@Oaphi Oaphi self-assigned this Aug 23, 2023
@Oaphi Oaphi requested a review from Taeir August 23, 2023 10:40
Copy link
Contributor

@Taeir Taeir left a comment

Choose a reason for hiding this comment

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

LGTM :)

@Taeir Taeir merged commit ed6a9d6 into develop Aug 23, 2023
2 checks passed
@Taeir Taeir deleted the 0valt/1169/fix-server-error-on-invalid-website-uri branch August 23, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants