Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@conico974
Copy link
Contributor

Refactor header handling to ensure fixes apply only once and only if necessary. Update tests to validate the new behavior of cache-control headers.

This fixes stale cache control header (for ISR) overriding cache control set in the middleware

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: 9c86966

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 28.03% 2858 / 10193
🔵 Statements 28.03% 2858 / 10193
🔵 Functions 52.46% 149 / 284
🔵 Branches 76.27% 720 / 944
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/open-next/src/core/routing/util.ts 88.56% 89.28% 95.45% 88.56% 174-179, 245-246, 322-324, 406-430
packages/open-next/src/http/openNextResponse.ts 1.35% 0% 0% 1.35% 20-433
Generated in workflow #1631 for commit 9c86966 by the Vitest Coverage Report Action

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 13, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/aws@1036

commit: 9c86966

* @__PURE__
*/
export function fixISRHeaders(headers: OutgoingHttpHeaders) {
const regex = /s-maxage=(\d+)/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do not capture if there is no need (it is slower)

Suggested change
const regex = /s-maxage=(\d+)/;
const regex = /s-maxage=\d+/;

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.
LGTM, one nit.

Copy link
Contributor

@sommeeeer sommeeeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

4 participants