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

FIX content-type to be compatible with HTML5 EventSource expectations #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions django_sse/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

try:
if django.VERSION < (1, 7):
from django.http import StreamingHttpResponse as HttpResponse
from django.http import StreamingHttpResponse
else:
from django.http.response import StreamingHttpResponse as HttpResponse
from django.http.response import StreamingHttpResponse
except ImportError:
from django.http import HttpResponse
from django.http import StreamingHttpResponse

from django.utils.decorators import method_decorator
from sse import Sse
Expand Down Expand Up @@ -39,7 +39,7 @@ def dispatch(self, request, *args, **kwargs):
self.args = args
self.kwargs = kwargs

response = HttpResponse(self._iterator(), content_type="text/event-stream")
response = StreamingHttpResponse(self._iterator(), content_type="text/event-stream")
response['Cache-Control'] = 'no-cache'
response['Software'] = 'django-sse'
return response
Expand Down