MCPcopy Create free account
hub / github.com/FreeMovieIR/freemovieir.github.io / shouldProxy

Function shouldProxy

js/apiClient.js:9–20  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

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;

Callers 1

requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected