@@ -1,5 +1,6 @@
|
||||
const SAME_SERVER_HOST = '1.92.206.90'
|
||||
const LEGACY_AUDIO_HOST = '47.120.48.148'
|
||||
import {
|
||||
dataSourceConfig
|
||||
} from '@/config/dataSource'
|
||||
|
||||
const isAbsoluteHttpUrl = (url: string) => /^https?:\/\//i.test(url)
|
||||
|
||||
@@ -9,7 +10,8 @@ export const normalizeSameOriginPublicUrl = (url: string | null | undefined) =>
|
||||
|
||||
try {
|
||||
const parsed = new URL(value)
|
||||
const isSameServer = parsed.hostname === SAME_SERVER_HOST
|
||||
const isSameServer = Boolean(dataSourceConfig.publicSameOriginAssetHost)
|
||||
&& parsed.hostname === dataSourceConfig.publicSameOriginAssetHost
|
||||
|
||||
if (
|
||||
isSameServer
|
||||
@@ -31,7 +33,8 @@ export const normalizeSameOriginPublicUrl = (url: string | null | undefined) =>
|
||||
}
|
||||
|
||||
if (
|
||||
parsed.hostname === LEGACY_AUDIO_HOST
|
||||
dataSourceConfig.publicLegacyAudioHost
|
||||
&& parsed.hostname === dataSourceConfig.publicLegacyAudioHost
|
||||
&& parsed.port === '19000'
|
||||
&& parsed.pathname.startsWith('/nhm/audio/')
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user