Open loomis opened 7 years ago
@loomis I wouldn't be surprised if you're the only user of event-source! - feel free to submit the PR.
(maybe being able to pass custom headers generally would be a cleaner solution)
@moea The PR is #28. I've added a unit test and done some other light testing. If you need something that needs fixing, let me know. If it looks ok, creating an updated 0.1.5 snapshot release would help us test more throughly.
0.1.5-SNAPSHOT updated
We're using SSE with a server that requires authentication. Since our authentication token is handled via cookies, the ClojureScript call to
event-source!
works correctly because the cookie is added automatically to the request by the browser. For Clojure however, the cookie needs to be passed to the request explicitly because the Aleph client doesn't have a cookie store. Looking through the code, there is no way at the moment to add a cookie header to theevent-source!
request.Would you be open to changing the implementation to pass a cookie value from
event-source!
to the underlying Clojure platform implementation? If so, I can try putting together a PR for this.