Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

cannot use cookie with event-source! #27

Open
loomis opened this issue Sep 1, 2017 · 4 comments
Open

cannot use cookie with event-source! #27

loomis opened this issue Sep 1, 2017 · 4 comments

Comments

@loomis
Copy link
Contributor

loomis commented Sep 1, 2017

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 the event-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.

@moea
Copy link
Member

moea commented Sep 1, 2017

@loomis I wouldn't be surprised if you're the only user of event-source! - feel free to submit the PR.

@moea
Copy link
Member

moea commented Sep 1, 2017

(maybe being able to pass custom headers generally would be a cleaner solution)

@loomis
Copy link
Contributor Author

loomis commented Sep 2, 2017

@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.

@moea
Copy link
Member

moea commented Sep 5, 2017

0.1.5-SNAPSHOT updated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants