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

Return 400 for character encoding errors #175

Merged
merged 2 commits into from
May 15, 2024

Conversation

ericmj
Copy link
Contributor

@ericmj ericmj commented May 15, 2024

This is usually an input error from the user and should return a 400 error.

This is usually an input error from the user and should return
a 400 error.
@SteffenDE
Copy link
Contributor

Very nice! I've seen this a couple of times in production projects. In one case I even added a

    # postgrex crashes when it encounters a null byte in a text field,
    # therefore we replace any null bytes in the string
    email = String.replace(email, "\u0000", "")

Happy to remove this in the future 👍

@josevalim josevalim changed the title Return 400 for UTF-8 encoding errors Return 400 for character encoding errors May 15, 2024
@josevalim josevalim merged commit d67a3b3 into phoenixframework:main May 15, 2024
2 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@ericmj ericmj deleted the ericmj/invalid-utf8-400 branch May 15, 2024 11:43
ericmj added a commit to hexpm/hexpm that referenced this pull request May 17, 2024
@inoas
Copy link

inoas commented May 17, 2024

Thank you!

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.

5 participants