Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f112f29

Browse filesBrowse files
committed
fix: filter out empty tags
1 parent 782a106 commit f112f29
Copy full SHA for f112f29

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎src/run/handlers/cache.cts

Copy file name to clipboardExpand all lines: src/run/handlers/cache.cts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
348348
if (requestContext?.didPagesRouterOnDemandRevalidate) {
349349
// encode here to deal with non ASCII characters in the key
350350
const tag = `_N_T_${key === '/index' ? '/' : encodeURI(key)}`
351-
const tags = tag.split(/,|%2c/gi)
351+
const tags = tag.split(/,|%2c/gi).filter(Boolean)
352352

353353
if (tags.length === 0) {
354354
return
@@ -384,9 +384,9 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
384384
private async doRevalidateTag(tagOrTags: string | string[], ...args: any) {
385385
getLogger().withFields({ tagOrTags, args }).debug('NetlifyCacheHandler.revalidateTag')
386386

387-
const tags = (Array.isArray(tagOrTags) ? tagOrTags : [tagOrTags]).flatMap((tag) =>
388-
tag.split(/,|%2c/gi),
389-
)
387+
const tags = (Array.isArray(tagOrTags) ? tagOrTags : [tagOrTags])
388+
.flatMap((tag) => tag.split(/,|%2c/gi))
389+
.filter(Boolean)
390390

391391
if (tags.length === 0) {
392392
return

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.