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

Function platformFetch

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

Source from the content-addressed store, hash-verified

238 * This elegantly covers all cases: localhost, LAN IPs, custom network setups.
239 */
240export const platformFetch = async (
241 input: RequestInfo | URL,
242 init?: RequestInit
243): Promise<Response> => {
244 const url = typeof input === 'string'
245 ? input
246 : input instanceof URL
247 ? input.href
248 : input.url;
249
250 // HTTP (not HTTPS) = likely local/private network
251 const isHttp = url.startsWith('http://');
252
253 if (isTauri() && isHttp && tauriFetchFn) {
254 Logger.debug('platform', `Using Tauri HTTP for: ${url}`);
255 return tauriFetchFn(input as any, init as any);
256 }
257
258 // Use regular fetch for HTTPS and web
259 return fetch(input, init);
260};
261
262/**
263 * Open a URL outside the app. Tauri webviews (especially mobile) ignore

Callers 15

fetchGgufFilesFunction · 0.90
checkOllamaSupportFunction · 0.90
fetchDecisionFunction · 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

Calls 2

isTauriFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected