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

Function applyEmbedProxy

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

Source from the content-addressed store, hash-verified

1202}
1203
1204function applyEmbedProxy(url: string): string {
1205 if (!settings.store.embedProxyEnabled) {
1206 return url;
1207 }
1208
1209 const service = getEmbedProxyService();
1210 if (!shouldProxyEmbedUrl(url)) {
1211 return url;
1212 }
1213
1214 switch (service) {
1215 case "cors":
1216 return toProxyUrl(url);
1217 case "nfp":
1218 return `https://discord.nfp.is/?v=${encodeURIComponent(url)}`;
1219 default:
1220 return toProxyUrl(url);
1221 }
1222}
1223
1224function isExeFileName(fileName: string): boolean {
1225 return fileName.toLowerCase().endsWith(".exe");

Callers 1

uploadPreparedBlobFunction · 0.85

Calls 3

getEmbedProxyServiceFunction · 0.85
shouldProxyEmbedUrlFunction · 0.85
toProxyUrlFunction · 0.85

Tested by

no test coverage detected