MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / toProxyUrl

Function toProxyUrl

utils/upload.ts:28–40  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

26export const logger = new Logger("BigFileUpload", "#7cb7ff");
27
28function toProxyUrl(url: string): string {
29 if ((settings.store as { disableCorsProxy?: boolean; }).disableCorsProxy) {
30 return url;
31 }
32
33 const corsProxyUrl = normalizeCorsProxyUrl((settings.store as { corsProxyUrl?: string; }).corsProxyUrl);
34
35 if (url.startsWith(`${corsProxyUrl}?url=`)) {
36 return url;
37 }
38
39 return toProxiedUrl(url, corsProxyUrl);
40}
41
42let isUploading = false;
43

Callers 3

fetchWithTimeoutFunction · 0.85
uploadRequestWithTimeoutFunction · 0.85
applyEmbedProxyFunction · 0.85

Calls 2

normalizeCorsProxyUrlFunction · 0.90
toProxiedUrlFunction · 0.90

Tested by

no test coverage detected