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) => {
53
53
if ( ! useFetch ) {
54
54
return response ?? next ( ) ;
55
55
}
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
+
56
61
const fetchResponse = await fetch ( request , {
57
62
redirect : "manual" ,
58
63
cache : "no-store" ,
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ export const createRedirectionIoMiddleware = (config: CreateMiddlewareConfig): M
80
80
if ( ! useFetch ) {
81
81
return response ?? next ( ) ;
82
82
}
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
+ }
83
87
84
88
const fetchResponse = await fetch ( request , {
85
89
redirect : "manual" ,
You can’t perform that action at this time.
0 commit comments