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

Conversation

xnopre
Copy link

@xnopre xnopre commented Mar 26, 2020

Replace HttpResponse with StreamingHttpResponse for event-stream content

Replace HttpResponse with StreamingHttpResponse for event-stream content
@xnopre
Copy link
Author

xnopre commented Mar 26, 2020

This package is simple and usefull, thanks ! But actually, we have a problem.

With this Javascript code :

const source = new EventSource('sse/');
source.onmessage = function(event) {
    ...
};

we have this error :

EventSource’s response has a MIME type (“text/html”) that is not “text/event-stream”. Aborting the connection.

This seems to be fixed by @ivencity but there is not PR. So I have forked his modifications to create this PR. I hope this can be merge as soon as possible.

Thanks

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

Successfully merging this pull request may close these issues.

2 participants