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

KeyError at /media/* 'content-type' every alternate response #12

Open
raiaman15 opened this issue Dec 26, 2020 · 0 comments
Open

KeyError at /media/* 'content-type' every alternate response #12

raiaman15 opened this issue Dec 26, 2020 · 0 comments

Comments

@raiaman15
Copy link

If a page contains any media file, or if we open media files in development (DEBUG=True), every second response shows this error.
Am I doing something wrong?

Console Output:
web_1 | [26/Dec/2020 09:08:39] "GET /media/1.png HTTP/1.1" 200 6440
web_1 | Internal Server Error: /media/1.png
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
web_1 | response = get_response(request)
web_1 | File "/usr/local/lib/python3.9/site-packages/livesync/core/middleware.py", line 12, in call
web_1 | return self.process_response(request, response)
web_1 | File "/usr/local/lib/python3.9/site-packages/livesync/core/middleware.py", line 16, in process_response
web_1 | if settings.DEBUG and 'text/html' in response['Content-Type']:
web_1 | File "/usr/local/lib/python3.9/site-packages/django/http/response.py", line 144, in getitem
web_1 | return self._headers[header.lower()][1]
web_1 | KeyError: 'content-type'
web_1 | [26/Dec/2020 09:08:41] "GET /media/1.png HTTP/1.1" 500 70679

@raiaman15 raiaman15 changed the title KeyError at /media/* 'content-type' every alternative response KeyError at /media/* 'content-type' every alternate response Dec 26, 2020
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

1 participant