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

exception in serving non-utf8 static files #32

Closed
adamyi opened this issue Apr 3, 2019 · 1 comment
Closed

exception in serving non-utf8 static files #32

adamyi opened this issue Apr 3, 2019 · 1 comment

Comments

@adamyi
Copy link
Contributor

adamyi commented Apr 3, 2019

asp-frontend_1  | [2019-04-03 01:55:31,242] ERROR in app: Exception on /assets/api_management_hero.png [GET]
asp-frontend_1  | Traceback (most recent call last):
asp-frontend_1  |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
asp-frontend_1  |     response = self.full_dispatch_request()
asp-frontend_1  |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1816, in full_dispatch_request
asp-frontend_1  |     return self.finalize_request(rv)
asp-frontend_1  |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1833, in finalize_request
asp-frontend_1  |     response = self.process_response(response)
asp-frontend_1  |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2112, in process_response
asp-frontend_1  |     response = handler(response)
asp-frontend_1  |   File "/usr/local/lib/python3.7/site-packages/flask_core/flag/__init__.py", line 31, in grep_flag
asp-frontend_1  |     data = str(response.get_data(), "utf-8")
asp-frontend_1  | UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
asp-frontend_1  | 129.94.8.170 - - [03/Apr/2019 01:55:31] "GET /assets/api_management_hero.png HTTP/1.1" 500 -
@cry
Copy link
Contributor

cry commented Apr 3, 2019

@zainafzal08 you need to handle these files correctly.

@adamyi I suggest enabling sendfile in your webserver and flask to see if you can bypass this issue

adamyi added a commit to adamyi/flask-core that referenced this issue Apr 5, 2019
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

No branches or pull requests

2 participants