Harden Node adapter HTTP server defaults and request body handling#15759
Merged
Harden Node adapter HTTP server defaults and request body handling#15759
Conversation
🦋 Changeset detectedLatest commit: de0fbb8 The changes in this PR will be included in the next version bump. 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 |
sarah11918
reviewed
Mar 5, 2026
# Conflicts: # packages/astro/src/core/app/node.ts # packages/integrations/node/src/serve-app.ts
sarah11918
approved these changes
Mar 5, 2026
Member
sarah11918
left a comment
There was a problem hiding this comment.
Changeset LGTM!
(I think in the past we've done things like split the patch and minor up, so that e.g. the patch is only about the timeout stuff, and the minor is only about the new config option. If you think it's fine to combine them like this, then it's good as written!)
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
ematipico
approved these changes
Mar 5, 2026
| * Wraps an async iterable with a size limit. If the total bytes received | ||
| * exceed the limit, an error is thrown. | ||
| */ | ||
| async function* limitAsyncIterable( |
Contributor
Author
There was a problem hiding this comment.
Iterables are comparitively, but there already is an iterable here (the request).
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.
Changes
createRequest()that enforces a maximum request body size via a streaming size-limiting wrappercreateAppHandlerapplies a default 1GB body size limit to prevent unbounded memory consumptionbodySizeLimitoption in the adapter, ex.node({ bodySizeLimit: Infinity })sets to no limitTesting
packages/astro/test/units/app/node.test.js:Docs