question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return 400 Invalid Request for non-ASCII URLs

See original GitHub issue

Recently launched our product internationally and around the same time started to receive the following UnicodeDecodeError from daphne:

Traceback (most recent call last):

File "/daphne/http_protocol.py", line 265, in serverResponse
  "path": self.uri.decode("ascii"),
UnicodeDecodeError: ‘ascii’ codec can't decode byte 0xd0 in position 10: ordinal not in range(128)

I’m currently running:

channels==1.1.8 daphne==1.3.0 asgi-redis==1.4.3 asgiref==1.1.2 Django==1.11.8

Any idea what might be causing this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewgodwincommented, Jan 12, 2018

I’m not sure if the browser will correctly urlencode it for you without trying it out (it should do, but I bet one or two of them don’t).

0reactions
andrewgodwincommented, Mar 17, 2018

Afraid not, the two codebases are substantially different.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is HTTP error 400 and how do you fix it? - IT PRO
1. Recheck the URL ... Since a malformed URL is the most common cause of the 400 Bad Request error, make sure there...
Read more >
How to Fix a 400 Bad Request Error: 8 Easy Methods
The 400 bad request error is an HTTP status code that describes an error ... A wrongly encoded URL can also contain wrongly...
Read more >
How To Fix A 400 Bad Request Error [Causes And Solutions]
A 400 bad request error indicates that the client's request was inaccurate or corrupted, and the server was unable to interpret it.
Read more >
Cookies with non-ASCII causing all endpoints to give status ...
The result being: Cookie is set incorrectly on one site and when the user "unknowingly" goes to our website, our website gives an...
Read more >
What is a Bad Request Error 400 and How Do You Fix It?
Malformed URL syntax; Outdated/corrupted DNS cache; Outdated browser cookies and cache; Large file size. 6 Methods to Fix the Error 400. Here's ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found