Skip to content

Commit 27973e6

Browse files
committed
Set PURGE method to purgeRoute function
1 parent d3ecec4 commit 27973e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/utils/purge.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ const purgePath = 'http://varnish'
55
/**Purges the given path from the varnish cache*/
66
export default async function purgeRoute(path: string) {
77
if (path.startsWith('/')) throw new SyntaxError(`path "${path}" cannot be absolute.`)
8-
await fetch(`${purgePath}/${path}`)
8+
await fetch(`${purgePath}/${path}`, {
9+
method: 'PURGE',
10+
})
911
}

0 commit comments

Comments
 (0)