File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ export const createRedirectionIoMiddleware = (config) => {
5353 if ( ! useFetch ) {
5454 return response ?? next ( ) ;
5555 }
56+ // Disable for server-actions and components.
57+ if ( request . headers . get ( 'Next-Action' ) ?. length || request . headers . get ( 'Accept' ) === "text/x-component" ) {
58+ return response ?? next ( ) ;
59+ }
60+
5661 const fetchResponse = await fetch ( request , {
5762 redirect : "manual" ,
5863 cache : "no-store" ,
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ export const createRedirectionIoMiddleware = (config: CreateMiddlewareConfig): M
8080 if ( ! useFetch ) {
8181 return response ?? next ( ) ;
8282 }
83+ // Disable for server-actions and components.
84+ if ( request . headers . get ( 'Next-Action' ) ?. length || request . headers . get ( 'Accept' ) === "text/x-component" ) {
85+ return response ?? next ( ) ;
86+ }
8387
8488 const fetchResponse = await fetch ( request , {
8589 redirect : "manual" ,
You can’t perform that action at this time.
0 commit comments