stackular
stackular

Reputation: 1471

How can I make EventSource work with any Content-Type header?

I have a server which sends data exactly in the format expected by the SSE client, but Chrome closes the connection immediately as it gets the Content-Type header with this message: EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.

Is it possible to make EventSource work even if the server doesn't set the appropriate text/event-stream content type?

Upvotes: 5

Views: 3512

Answers (1)

Darren Cook
Darren Cook

Reputation: 28928

It is not possible, sorry. In fact a browser that did not would not be following the standard.

(I think the motivation for a new MIME type was that proxies could recognize it and treat it differently.)

Upvotes: 2

Related Questions