fix(mobile): bypass ngrok browser interstitial
This commit is contained in:
@@ -23,7 +23,7 @@ import type { PairingConnectionPayload, PairingEndpointCandidate } from '@/lib/c
|
||||
import { isCapacitorApp } from '@/lib/platform';
|
||||
import { adoptRelayTunnel, isRelayModeActive } from '@/lib/relay/runtime-tunnel';
|
||||
import { createRelayTunnelClient } from '@/lib/relay/tunnel-client';
|
||||
import { runtimeFetch } from '@/lib/runtime-fetch';
|
||||
import { addRuntimeProxyHeaders, runtimeFetch } from '@/lib/runtime-fetch';
|
||||
import { getRuntimeApiBaseUrl, getRuntimeKey, switchRuntimeEndpoint } from '@/lib/runtime-switch';
|
||||
|
||||
import { recordMobileConnectDebug } from './mobileConnectionDebug';
|
||||
@@ -346,11 +346,11 @@ const nativeHttpRequest = async (url: string, init?: RequestInit): Promise<Mobil
|
||||
if (!isCapacitorApp()) return null;
|
||||
try {
|
||||
const { CapacitorHttp } = await import('@capacitor/core');
|
||||
const headers = Object.fromEntries(new Headers(init?.headers).entries());
|
||||
const requestHeaders = addRuntimeProxyHeaders(url, new Headers(init?.headers));
|
||||
const response = await CapacitorHttp.request({
|
||||
url,
|
||||
method: init?.method || 'GET',
|
||||
headers,
|
||||
headers: Object.fromEntries(requestHeaders.entries()),
|
||||
data: getJsonRequestData(init?.body),
|
||||
});
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user