allow google storage file (#1935)

This commit is contained in:
EnzoVezzaro 2023-06-26 14:52:59 -04:00 committed by GitHub
parent 9db01b6a30
commit a5b0ecf4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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
}