Hi,

I'm trying to use the /db/_changes feed in a phonegap application in iOS.
I have specified the parameter feed=eventsource to use server-side events 
but it seems Couchbase is returning the wrong MIME type and Safari Mobile 
aborts the connection.

This is a snippet of the code:

var eventSource = new EventSource(
"http://lite.couchbase./mydb/_changes?feed=eventsource&include_docs=true";);
eventSource.onopen = function (e) {
 console.log("EventSource opened", e);
};
eventSource.onerror = function (e) {
 console.log("EventSource failed", e);
};
eventSource.onmessage = function (e) {
 console.log("EventSource message", e.data);
};


As soon as it executes, Safari logs the error below in the console, the 
onerror handler gets called and the EventSource closed.

[Error] EventSource's response has a MIME type ("application/json") that is 
not "text/event-stream". Aborting the connection. (index.html, line 0)

Is it possible to change the MIME type returned on the internal 
(http://lite.couchbase.) server?
Has anybody have any luck using EventSource feed?

I'll raise a bug in the issue tracker but was just checking the forum first.

Thanks
Juan

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/73e6ed94-d135-4a15-81d1-30bc77db5be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to