Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: EventSource/eventsource
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.5
Choose a base ref
...
head repository: EventSource/eventsource
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.6
Choose a head ref
  • 8 commits
  • 9 files changed
  • 2 contributors

Commits on Feb 5, 2025

  1. docs: fix invalid markdown in security policy

    rexxars committed Feb 5, 2025
    Copy the full SHA
    81f8cff View commit details

Commits on Feb 20, 2025

  1. docs: add workaround for strict content-type checking to migration guide

    rexxars committed Feb 20, 2025
    Copy the full SHA
    23932db View commit details

Commits on Mar 14, 2025

  1. chore: upgrade dependencies

    rexxars committed Mar 14, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    rexxars Espen Hovlandsdal
    Copy the full SHA
    8aa7057 View commit details

Commits on Mar 27, 2025

  1. fix: upgrade parser to latest version, improving performance

    rexxars committed Mar 27, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    rexxars Espen Hovlandsdal
    Copy the full SHA
    59a5ddd View commit details
  2. chore: upgrade bun lockfile

    rexxars committed Mar 27, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    rexxars Espen Hovlandsdal
    Copy the full SHA
    12f7951 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    rexxars Espen Hovlandsdal
    Copy the full SHA
    fae8c99 View commit details
  4. chore: upgrade deno lockfile

    rexxars committed Mar 27, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    rexxars Espen Hovlandsdal
    Copy the full SHA
    55b870d View commit details
  5. Copy the full SHA
    20869db View commit details
Showing with 1,226 additions and 1,831 deletions.
  1. +6 −0 CHANGELOG.md
  2. +30 −0 MIGRATION.md
  3. +1 −1 SECURITY.md
  4. BIN bun.lockb
  5. +613 −777 deno.lock
  6. +564 −1,046 package-lock.json
  7. +6 −6 package.json
  8. +5 −1 test/server.ts
  9. +1 −0 tsconfig.settings.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.0.6](https://github.com/EventSource/eventsource/compare/v3.0.5...v3.0.6) (2025-03-27)

### Bug Fixes

* upgrade parser to latest version, improving performance ([59a5ddd](https://github.com/EventSource/eventsource/commit/59a5ddd135da957456ab93e72fd65a87a9578204))

## [3.0.5](https://github.com/EventSource/eventsource/compare/v3.0.4...v3.0.5) (2025-01-28)

### Bug Fixes
30 changes: 30 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -85,3 +85,33 @@ The default reconnect timeout is now 3 seconds - up from 1 second in v1/v2. This
Redirect handling now matches Chrome/Safari. On disconnects, we will always reconnect to the _original_ URL. In v1/v2, only HTTP 307 would reconnect to the original, while 301 and 302 would both redirect to the _destination_.

While the _ideal_ behavior would be for 301 and 308 to reconnect to the redirect _destination_, and 302/307 to reconnect to the _original_ URL, this is not possible to do cross-platform (cross-origin requests in browsers do not allow reading location headers, and redirect handling will have to be done manually).

#### Strict checking of Content-Type header

The `Content-Type` header is now checked. It's value must be `text/event-stream` (or
`text/event-stream; charset=utf-8`), and the connection will be failed otherwise.

To maintain the previous behaviour, you can use the `fetch` option to override the
returned `Content-Type` header if your server does not send the required header:

```ts
const es = new EventSource('https://my-server.com/sse', {
fetch: async (input, init) => {
const response = await fetch(input, init)

if (response.headers.get('content-type').startsWith('text/event-stream')) {
// Valid header, forward response
return response
}

// Server did not respond with the correct content-type - override it
const newHeaders = new Headers(response.headers)
newHeaders.set('content-type', 'text/event-stream')
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: newHeaders,
})
},
})
```
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@

## Reporting a Vulnerability

If you find a security vulnerability, do **NOT** open an issue. Use the [https://github.com/EventSource/eventsource/security/advisories/new](GitHub Security Advisory) page instead.
If you find a security vulnerability, do **NOT** open an issue. Use the [GitHub Security Advisory](https://github.com/EventSource/eventsource/security/advisories/new) page instead.
Binary file modified bun.lockb
Binary file not shown.
Loading