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

Skip to content

fix 304 incorrectly set as 200 #632

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

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Conversation

conico974
Copy link
Contributor

Fix #631

Copy link

changeset-bot bot commented Nov 16, 2024

🦋 Changeset detected

Latest commit: 2ecb6ca

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

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-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

Copy link

pkg-pr-new bot commented Nov 16, 2024

Open in Stackblitz

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

commit: 2ecb6ca

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.

What about your comment on the issue:

Yeah unfortunately the way next does thing cause a race condition. There is no good way to do this.
The fix works well with streaming wrapper, but not with non streaming one because by the time the request is done and ready to be sent, next has already reset it.
And not applying the status code Next sets will cause the initial issue in Next appear again.
I'll try to open an issue in the Next repo when I got some time, the fix should be done upstream.

Would there be a way to add test?

@conico974
Copy link
Contributor Author

Would there be a way to add test?

Not with our current setup, as i said in a previous comment in the issue, this does not happen with the default cloudfront policy (which is what we use).
In order to test this properly we would have to run OpenNext locally without cloudfront ( which is probably what we should implement at some point so that we could run more e2e test more easily )

@conico974
Copy link
Contributor Author

@vicb unless there is something you'd want changed, i'm gonna merge this one and make a release

@vicb
Copy link
Contributor

vicb commented Nov 21, 2024

Great, thanks!

@conico974 conico974 merged commit 8b51108 into opennextjs:main Nov 21, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Nov 21, 2024
@conico974 conico974 deleted the fix/etag branch March 14, 2025 12:45
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.

Conditional GET requests don't appear to be handled correctly
2 participants