jadsonlucio / django-autorefresh

automatic refresh your html page of your django project
1 stars 0 forks source link

KeyError: 'content-type' is being raised when reloading pages with images. #6

Open JoaoG250 opened 3 years ago

JoaoG250 commented 3 years ago

https://github.com/jadsonlucio/django-autorefresh/blob/09fe7257d280c3fb4be8693f7eb7cd97595bff46/fresh/middleware.py#L45

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.8/site-packages/fresh/middleware.py", line 96, in call return self.process_template_response(request, response) File "/usr/local/lib/python3.8/site-packages/fresh/middleware.py", line 45, in process_template_response mimetype = response.headers["content-type"] File "/usr/local/lib/python3.8/site-packages/django/utils/datastructures.py", line 316, in getitem return self._store[key.lower()][1] KeyError: 'content-type'

JoaoG250 commented 3 years ago

PS: When hard reloading with Ctrl + F5 the exception is not raised.

jadsonlucio commented 3 years ago

@JoaoG250 fixed in branch fix-content-type-error