1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

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

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
}