Skip to content

UnicodeDecodeError on headers with bad characters #7749

Discussion options

You must be logged in to vote

This one is tangential, but might also be worth exploring...

That Django uses settings.DEFAULT_CHARSET for QueryDict https://github.com/django/django/blob/master/django/http/request.py#L377 seems odd too - the server settings shouldn't be affecting how we parse incoming requests, nor does it match up with the documented meaning...

Default charset to use for all HttpResponse objects, if a MIME type isn’t manually specified. Used with DEFAULT_CONTENT_TYPE to construct the Content-Type header.

Which is perfectly reasonable, but isn't at all how it's being used in the QueryDict context.


In summary: I believe there may be 2 or 3 independent PRs/issues to work through with the Django team here.

Replies: 16 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by auvipy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@auvipy
Comment options

@peterthomassen
Comment options

@auvipy
Comment options

@peterthomassen
Comment options

@auvipy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
9 participants
Converted from issue

This discussion was converted from issue #4142 on March 03, 2021 14:20.