Skip to content

Commit

Permalink
allow google storage file (#1935)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoVezzaro authored Jun 26, 2023
1 parent 9db01b6 commit a5b0ecf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/@utils/url/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export function sanitizeUrl(url: string) {
export const isGoogleUrl = (url: string): boolean => {
if (!url || !isUrl(url)) return

const googleUrl = new URL(url)
return googleUrl.hostname.endsWith('google.com')
const urlString = new URL(url)
const googleUrl = urlString.hostname.endsWith('google.com')
const isGoogleStorage = urlString.hostname.endsWith(
'storage.cloud.google.com'
)
return isGoogleStorage ? false : googleUrl
}

1 comment on commit a5b0ecf

@vercel
Copy link

@vercel vercel bot commented on a5b0ecf Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.