File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,9 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
147147 ) {
148148 // pages router doesn't have cache tags headers in PAGE cache value
149149 // so we need to generate appropriate cache tags for it
150- const cacheTags = [ `_N_T_${ key === '/index' ? '/' : key } ` ]
150+ // encode here to deal with non ASCII characters in the key
151+
152+ const cacheTags = [ `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } ` ]
151153 requestContext . responseCacheTags = cacheTags
152154 }
153155 }
@@ -341,7 +343,8 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
341343 if ( data ?. kind === 'PAGE' || data ?. kind === 'PAGES' ) {
342344 const requestContext = getRequestContext ( )
343345 if ( requestContext ?. didPagesRouterOnDemandRevalidate ) {
344- const tag = `_N_T_${ key === '/index' ? '/' : key } `
346+ // encode here to deal with non ASCII characters in the key
347+ const tag = `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } `
345348 getLogger ( ) . debug ( `Purging CDN cache for: [${ tag } ]` )
346349 requestContext . trackBackgroundWork (
347350 purgeCache ( { tags : [ tag ] } ) . catch ( ( error ) => {
You can’t perform that action at this time.
0 commit comments