Skip to content

Commit

Permalink
fix(prerender): check link's pathname only for extensions (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli authored Jan 13, 2023
1 parent 0211e60 commit 6585e8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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] || "";
}

0 comments on commit 6585e8d

Please sign in to comment.