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

Catch UnicodeDecodeError in extract_ajax_token #63

Merged

Conversation

ohnomydjango
Copy link
Contributor

Ensure that any unicode decoding errors are caught while we load the json request body. If that's the case, return None from extract_ajax_token.

This fixes the scenario where invalid utf-8 characters pass through json.loads() and cause the program to crash.

This PR is in response to #62.

@@ -48,7 +48,7 @@ deps =
ruff

commands =
ruff request_token
ruff check request_token
Copy link

Choose a reason for hiding this comment

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

Just curious, what is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ruff changed the command we need to do at some point in the past in few months.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See here. It needs the check command.

@ohnomydjango ohnomydjango merged commit 9b964ff into master Oct 23, 2024
17 checks passed
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