Allow using without a CORS proxy (#1011)
CORS can be disabled, or the server can be configured to send CORS headers. So, it would be useful to be able to skip the CORS proxy.
This commit is contained in:
parent
eac866a505
commit
b4ec1711c7
1 changed files with 3 additions and 0 deletions
|
|
@ -11,5 +11,8 @@ export function normalizeCorsProxyUrl(url?: string): string {
|
|||
}
|
||||
|
||||
export function toProxiedUrl(url: string, corsProxyUrl = CORS_PROXY): string {
|
||||
if (corsProxyUrl == "none") {
|
||||
return url;
|
||||
}
|
||||
return `${normalizeCorsProxyUrl(corsProxyUrl)}?url=${encodeURIComponent(url)}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue