peachsim 0.1.683 → 0.1.685
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/drivers/playwright-sim-host.ts +6 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +39 -7
- package/dist-lib/host/fetch-proxy-handler.cjs +12 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +6 -5
- package/dist-lib/host/fetch-proxy-overrides.mjs +5 -4
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +45 -13
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/host/fetch-proxy-handler.ts +10 -1
- package/src/host/fetch-proxy-overrides.ts +17 -13
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// shared upstream header policy for SootSim's CORS-bypassing fetch proxy.
|
|
2
2
|
// requests still forward tenant auth and app headers, but the proxy transport
|
|
3
|
-
// defaults to native-app semantics: no browser Origin, Referer, Sec-Fetch
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
3
|
+
// defaults to native-app semantics: no browser Origin, Referer, Sec-Fetch-*.
|
|
4
|
+
// the User-Agent an NSURLSession request on a real device sends is the
|
|
5
|
+
// app's own (`<app>/<version> CFNetwork/<cf> Darwin/<darwin>`), never a
|
|
6
|
+
// browser string; the engine computes that shape (bundle-exec/app-config
|
|
7
|
+
// identity + the device profile's OS) and hands it to the proxy through this
|
|
8
|
+
// header, since `fetch()` cannot set `User-Agent` itself (forbidden header
|
|
9
|
+
// name). web-backed mobile APIs that require a specific web origin opt in
|
|
10
|
+
// below.
|
|
7
11
|
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
// way a real device's absent ones read — not a browser, not restricted.
|
|
13
|
-
export const FETCH_PROXY_BROWSER_USER_AGENT =
|
|
14
|
-
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 ' +
|
|
15
|
-
'(KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36'
|
|
12
|
+
// the engine attaches the native-shaped User-Agent it computed under this
|
|
13
|
+
// name; the proxy moves it onto the real `user-agent` header and never lets
|
|
14
|
+
// the name itself reach upstream (see STRIP_FETCH_PROXY_HEADERS).
|
|
15
|
+
export const FETCH_PROXY_NATIVE_USER_AGENT_HEADER = 'x-sootsim-native-user-agent'
|
|
16
16
|
|
|
17
17
|
const HOST_HEADER_OVERRIDES: Array<{
|
|
18
18
|
hostSuffix: string
|
|
@@ -82,10 +82,14 @@ export function resolveFetchProxyTargetUrl(requested: URL): URL {
|
|
|
82
82
|
return replacement ? new URL(replacement) : requested
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function getFetchProxyTargetHeaders(
|
|
85
|
+
export function getFetchProxyTargetHeaders(
|
|
86
|
+
targetUrl: URL,
|
|
87
|
+
nativeUserAgent?: string,
|
|
88
|
+
): Record<string, string> {
|
|
86
89
|
const hostOverrides = headerOverridesFor(targetUrl.hostname)
|
|
87
90
|
return {
|
|
88
91
|
'accept-encoding': 'identity',
|
|
92
|
+
...(nativeUserAgent ? { 'user-agent': nativeUserAgent } : {}),
|
|
89
93
|
...hostOverrides?.headers,
|
|
90
94
|
}
|
|
91
95
|
}
|