Skip to content

Commit f3c9b64

Browse files
authored
fix: encode cache tags provided by Next.js for App Router (#3384)
1 parent 0b32b34 commit f3c9b64

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/run/handlers/cache.cts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
157157
cacheValue.kind === 'APP_ROUTE'
158158
) {
159159
if (cacheValue.headers?.[NEXT_CACHE_TAGS_HEADER]) {
160-
const cacheTags = (cacheValue.headers[NEXT_CACHE_TAGS_HEADER] as string).split(/,|%2c/gi)
160+
const cacheTags = (cacheValue.headers[NEXT_CACHE_TAGS_HEADER] as string)
161+
.split(/,|%2c/gi)
162+
.map(encodeURI)
161163
requestContext.responseCacheTags = cacheTags
162164
} else if (
163165
(cacheValue.kind === 'PAGE' || cacheValue.kind === 'PAGES') &&

0 commit comments

Comments
 (0)