MCPcopy Create free account
hub / github.com/Roy3838/Observer / platformFetch

Function platformFetch

app/src/utils/platform.ts:238–258  ·  view source on GitHub ↗
(
  input: RequestInfo | URL,
  init?: RequestInit
)

Source from the content-addressed store, hash-verified

236 * This elegantly covers all cases: localhost, LAN IPs, custom network setups.
237 */
238export const platformFetch = async (
239 input: RequestInfo | URL,
240 init?: RequestInit
241): Promise<Response> => {
242 const url = typeof input === 'string'
243 ? input
244 : input instanceof URL
245 ? input.href
246 : input.url;
247
248 // HTTP (not HTTPS) = likely local/private network
249 const isHttp = url.startsWith('http://');
250
251 if (isDesktop() && isHttp && tauriFetchFn) {
252 Logger.debug('platform', `Using Tauri HTTP for: ${url}`);
253 return tauriFetchFn(input as any, init as any);
254 }
255
256 // Use regular fetch for HTTPS and non-desktop platforms
257 return fetch(input, init);
258};

Callers 15

checkOllamaSupportFunction · 0.90
checkLocalhostFunction · 0.90
fetchResponseFunction · 0.90
fetchFromAddressMethod · 0.90
checkServerMethod · 0.90
pullModelFunction · 0.90
sendGotifyFunction · 0.90
askFunction · 0.90
messageFunction · 0.90
system_notifyFunction · 0.90
overlayFunction · 0.90

Calls 2

isDesktopFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected