Skip to content
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

bug: v1.8 loaders have empty request.headers when called after action #4826

Closed
wants to merge 1 commit into from

Conversation

nrako
Copy link
Contributor

@nrako nrako commented Dec 11, 2022

This is a bug report: yarn bug-report-test


Prior to Remix v1.8.0 the loader function when called subsequentially to a (POST) action would have the request's headers set. Since v1.8 this is not the case anymore.

This is highlyt problematic. For example, if you have some high level session based cookie which is used to guard GET request in the page action (or a parent layout route); the authentication would fail every time the loaders data is retrieved subsequentially to a POST action.

Prior to Remix v1.8.0 the loader function when called subsequentially to
a (POST) action would have the request's `headers` set. Since v1.8 this
is not the case anymore.

This is highlyt problematic. For example, if you have some high level
session based cookie which is used to guard GET request in the page
action (or a parent layout route); the authentication would fail every
time the loaders data is retrieved subsequentially to a POST action.
@changeset-bot
Copy link

changeset-bot bot commented Dec 11, 2022

⚠️ No Changeset found

Latest commit: 9c063cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nrako
Copy link
Contributor Author

nrako commented Dec 11, 2022

By the way, at first I verified things in isolation in that codesandbox if that can be of any use to anyone: https://codesandbox.io/s/hardcore-ben-hwsb4j?file=/app/routes/demos/actions.tsx

Just flip @remix-run/serve between 1.7.6 and 1.8.0 (or later) and don't forgot to restart the server in between your manual tests on the /demos/actions page.

@brophdawg11
Copy link
Contributor

Thanks! Moved this out of the bug report test and added some additional test in #4829. The underlying fix for this is over in react-router: remix-run/react-router#9721

@brophdawg11
Copy link
Contributor

Hey @nrako - just FYI this fix is available in a 1.9.0-pre.0 release if you wanted to give it a test! We're hoping to get the stable 1.9.0 out later today or tomorrow.

@nrako
Copy link
Contributor Author

nrako commented Dec 16, 2022

Thanks for letting me know @brophdawg11, I did a quick test with @remix-run/server-runtime and that looks great, my tests are all green. thx for Remix's team great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants