File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,6 @@ const defaultHandler = async (
129129 result . headers [ INTERNAL_EVENT_REQUEST_ID ] = requestId ;
130130 }
131131
132- // Can safely delete this header here before returning as it is only used for the cache tags internally
133- delete result . headers [ "x-next-cache-tags" ] ;
134-
135132 debug ( "Middleware response" , result ) ;
136133 return result ;
137134 } ,
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ export function getTagsFromValue(value?: CacheValue<"cache">) {
3939 }
4040 // The try catch is necessary for older version of next.js that may fail on this
4141 try {
42- return value . meta ?. headers ?. [ "x-next-cache-tags" ] ?. split ( "," ) ?? [ ] ;
42+ const cacheTags =
43+ value . meta ?. headers ?. [ "x-next-cache-tags" ] ?. split ( "," ) ?? [ ] ;
44+ delete value . meta ?. headers ?. [ "x-next-cache-tags" ] ;
45+ return cacheTags ;
4346 } catch ( e ) {
4447 return [ ] ;
4548 }
You can’t perform that action at this time.
0 commit comments