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

Internal Server Error 500 on POST requests containing non-ASCII characters (multipart/form-data with a picture) #73

Closed
patricks-dev opened this issue Oct 11, 2023 · 0 comments · Fixed by #105
Assignees
Labels
bug Something isn't working

Comments

@patricks-dev
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

What did you do?

Apply a slight modification to the example from README.md under Quickstart, so it would accept POST requests. Then start the test server and post a multipart/form-data including a picture, with curl:

curl -v -F filename=picture.jpg -F upload=@/full/path/to/picture.jpg http://localhost:8080

What did you expect to see?

"Hello World!"

What did you see instead?

*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Length: 2175522
> Content-Type: multipart/form-data; boundary=------------------------c892a83a67802793
> Expect: 100-continue
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 INTERNAL SERVER ERROR
< Server: Werkzeug/3.0.0 Python/3.10.12
< Date: Wed, 11 Oct 2023 09:11:02 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 21974
< Connection: close

[...]

ValueError: string argument should contain only ASCII characters // Werkzeug Debugger

[...]

Traceback:
File "/usr/lib/python3.10/base64.py", line 37, in _bytes_from_decode_data

[...]

During handling of the above exception, another exception occurred:
File "~/.local/lib/python3.10/site-packages/flask/app.py, line 2213, in __call__

[...]

The WSGI server calls the Flask application object as the WSGI application. This calls :meth:`wsgi_app`, which can be wrapped to apply middleware.

[...]

What version of Python are you using (python --version)?

Python 3.10.12

Does this issue reproduce with the latest release?

Yes

@patricks-dev patricks-dev added the bug Something isn't working label Oct 11, 2023
@cyclimse cyclimse self-assigned this Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants