(url)
| 7 | } |
| 8 | |
| 9 | function shouldProxy(url) { |
| 10 | if (!url || directSameOriginPaths.some(pattern => pattern.test(url))) { |
| 11 | return false; |
| 12 | } |
| 13 | |
| 14 | try { |
| 15 | const parsedUrl = new URL(url, window.location.href); |
| 16 | return parsedUrl.origin !== window.location.origin; |
| 17 | } catch (error) { |
| 18 | return false; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | async function fetchWithTimeout(url, options = {}) { |
| 23 | const timeoutMs = options.timeoutMs || config.requestTimeoutMs || 12000; |