update 0.6.7 changelog and provider url handling (#1174)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const APIKEY_FUN_BASE_URL = 'https://api.apikey.fun/v1'
|
||||
|
||||
export function normalizeCustomProviderBaseUrl(baseUrl: string): string {
|
||||
const value = baseUrl.trim()
|
||||
if (!value) return value
|
||||
|
||||
try {
|
||||
const parsed = new URL(value)
|
||||
if (parsed.hostname.toLowerCase() === 'api.apikey.fun') return APIKEY_FUN_BASE_URL
|
||||
} catch {
|
||||
// Fall back to a string match so partially typed values still normalize on submit.
|
||||
if (/^https:\/\/api\.apikey\.fun(?:\/|$)/i.test(value)) return APIKEY_FUN_BASE_URL
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
Reference in New Issue
Block a user