-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Remove encodeURIComponent #64
Comments
Hello @aubergene , thanks for the issue. I believe you're correct. sveltekit-sse/src/lib/produce.js Lines 36 to 45 in e5ade90
That was my main concern initially, but since JS is single threaded there shouldn't be any risk for a different I'll run tests without the uri encoding/decoding and make sure it still behaves the same. |
Also yes, it's splitting the string then encoding the chunks, which makes no sense. |
Everything looks fine without the uri encoding/decoding, I've just release version 0.13.12. |
Thank you! That's great |
Currently produce splits on new line and then runs
encodeURIComponent
on each item, which I think could be removed. You stated in #63but this is already happening
emit('message',
the time is ${Date.now()}\nhere's a new line);
I'm proposing the output should look like below, so newlines produce another data output, which I think meets the spec
I'm looking to use this to replace an existing SSE endpoint where we're outputting JSON on a single line so the URI encoding breaks our existing consumers
Big thanks for this library it's great otherwise. Happy to write a PR but wanted to check thoughts first in a issue
The text was updated successfully, but these errors were encountered: