Skip to content
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

Casing of Last-Event-ID header must be exact or duplicate events can be received after reconnect #182

Open
cdhowie opened this issue Jul 13, 2021 · 0 comments

Comments

@cdhowie
Copy link

cdhowie commented Jul 13, 2021

I am observing the following behavior with the current npm version of this library (1.1.0).

If the following sequence of events occurs:

  • EventSource is constructed with an explicit header value for Last-Event-ID but with different casing.
  • At least one event with an ID is received.

On the next successful reconnection, this library will send the initially-provided Last-Event-ID value instead of the most recent event ID. This can cause a gigantic amount of history to be replayed on the server and duplicate messages received, depending on how many messages were received since the instance was constructed.

As HTTP headers are case-insensitive, it seems wrong that the casing of the Last-Event-ID header provided to the constructor should in any way affect the observable behavior of this library.

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

No branches or pull requests

1 participant