diff --git a/src/prerender.ts b/src/prerender.ts index 9daad9555d..00f1d0529d 100644 --- a/src/prerender.ts +++ b/src/prerender.ts @@ -276,6 +276,7 @@ function extractLinks( const EXT_REGEX = /\.[\da-z]+$/; -function getExtension(path: string): string { - return (path.match(EXT_REGEX) || [])[0] || ""; +function getExtension(link: string): string { + const pathname = parseURL(link).pathname; + return (pathname.match(EXT_REGEX) || [])[0] || ""; }