Skip to content

Commit

Permalink
Allow CDN urls on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
big213 committed Sep 27, 2023
1 parent 33b2413 commit 60dbe75
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/services/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,18 @@ export function generateEventText(

// currently only Imgur/Streamable/YT links supported
export function isValidEvidenceLink(link: string) {
return link.match(/youtu\.be|youtube\.com|streamable\.com|imgur\.com/)
return (
link.match(/youtu\.be|youtube\.com|streamable\.com|imgur\.com/) ||
isCdnUrl(link)
)
}

export function isVideoUrl(url: string) {
return url.match(
/(\.(gif|mp4)$)|(youtu\.be|youtube\.com|streamable\.com|gfycat\.com)/
)
}

export function isCdnUrl(url: string) {
return !!url.match(/^https:\/\/cdn.osrsrecords.com/)
}

0 comments on commit 60dbe75

Please sign in to comment.