Repository navigation
fix: add X-Accel-Buffering: no header to text/event-stream responses - #16156
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: f95b9d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Conduitry
reviewed
Jun 24, 2026
Co-authored-by: Conduitry <[email protected]>
Conduitry
approved these changes
Jun 24, 2026
Merged
Rich-Harris
pushed a commit
that referenced
this pull request
Jun 24, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @sveltejs/[email protected] ### Minor Changes - feat: expose `RemoteFormEnhanceInstance` and `RemoteFormEnhanceCallback` types ([#15816](#15816)) - feat: set value of `submit` fields when form is submitted ([#15979](#15979)) ### Patch Changes - fix: skip `native_navigation` when `__data.json` returns 404 on a static fallback page ([#16135](#16135)) - fix: ignore third-party monkeypatches in `pushState`/`replaceState` warning detection ([#15267](#15267)) - fix: snapshot form fields on read ([#16150](#16150)) - fix: strip field prefix before erroring on duplicates ([#16151](#16151)) - fix: call reset function via prototype ([#16138](#16138)) - chore: fix navigation `type` hover info ([#16147](#16147)) ## @sveltejs/[email protected] ### Patch Changes - fix: add `X-Accel-Buffering: no` header to `text/event-stream` responses to prevent reverse proxies such as nginx from buffering streamed responses ([#16156](#16156)) - fix: delete existing socket file on startup ([#15449](#15449)) - Updated dependencies [[`c426c6e`](c426c6e), [`81f253e`](81f253e), [`8d3c865`](8d3c865), [`6bde3b6`](6bde3b6), [`9161740`](9161740), [`2184960`](2184960), [`5e319b6`](5e319b6), [`e82a0a8`](e82a0a8)]: - @sveltejs/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Merged
5 of 6 tasks
teemingc
pushed a commit
that referenced
this pull request
Nov 13, 2026
…rameters in adapter-node (#17687) adapter-node only adds `X-Accel-Buffering: no` (added in #16156 so nginx doesn't buffer SSE) when the content type is exactly `text/event-stream`. A response with a parameter, which is common, doesn't get it: ```js // src/routes/events/+server.js export function GET() { return new Response('data: hello\n\n', { headers: { 'content-type': 'text/event-stream; charset=utf-8' } }); } ``` With adapter-node, `curl -I` on that route has no `x-accel-buffering` header, so the stream gets buffered behind nginx again. adapter-bun already checks with `startsWith('text/event-stream')`, so the same app behaves differently on the two adapters. This changes the adapter-node check to `startsWith`, matching adapter-bun. I added a `/event-stream/charset` route and a test to the adapter-node `basic` app. On `main` the new test fails with: ``` Expected: "no" Received: undefined ``` With the change, all 16 tests in that app pass, as do the adapter-node unit and build tests. `pnpm lint` and `pnpm check` pass too. --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #15790, closes #16130. On nginx, responses are buffered by default to spare servers from keeping connections open to slow clients. When the response in question is an event stream, this is a very silly thing to do.
This PR fixes it by adding the
x-accel-buffering: noheader in those cases.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits