-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Fix loader request on document POST requests #9721
Changes from 4 commits
09ef995
9315bf7
b06ad04
f3541dd
27fbb08
8db43ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/router": patch | ||
--- | ||
|
||
Persist method/headers on loader requests after SSR document action request |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2256,8 +2256,14 @@ export function unstable_createStaticHandler( | |
}; | ||
} | ||
|
||
// Create a GET request for the loaders | ||
let loaderRequest = new Request(request.url, { signal: request.signal }); | ||
// Create a request for the loaders | ||
let loaderRequest = new Request(request.url, { | ||
body: null, | ||
headers: request.headers, | ||
method: request.method, | ||
redirect: request.redirect, | ||
signal: request.signal, | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as Remix was doing in 1.7.6: https://github.com/remix-run/remix/blob/remix%401.7.6/packages/remix-server-runtime/server.ts#L418 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the moment we are not persisting |
||
let context = await loadRouteData(loaderRequest, matches, requestContext); | ||
|
||
return { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
query
is a single document-levelPOST
request the loaders reflectPOST
as well, but we don't proxy along thebody