Skip to content

Commit 30b6b54

Browse files
authored
fix(ios): 18.4 simulator networking case (#10732)
1 parent 96af6fa commit 30b6b54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/http/http-request/index.ios.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import * as httpModule from '../../http';
33
import * as imageSourceModule from '../../image-source';
44
import * as fsModule from '../../file-system';
55

6+
import { SDK_VERSION } from '../../utils/constants';
7+
import { isRealDevice } from '../../utils/ios';
68
import * as types from '../../utils/types';
79
import * as domainDebugger from '../../debugger';
810
import { getFilenameFromUrl } from './http-request-common';
@@ -19,7 +21,9 @@ const osVersion = currentDevice.systemVersion;
1921
const GET = 'GET';
2022
const USER_AGENT_HEADER = 'User-Agent';
2123
const USER_AGENT = `Mozilla/5.0 (i${device}; CPU OS ${osVersion.replace('.', '_')} like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/${osVersion} Mobile/10A5355d Safari/8536.25`;
22-
const sessionConfig = NSURLSessionConfiguration.ephemeralSessionConfiguration;
24+
// mitigate iOS 18.4 simulator regression
25+
// https://developer.apple.com/forums/thread/777999
26+
const sessionConfig = SDK_VERSION === 18.4 && !isRealDevice() ? NSURLSessionConfiguration.ephemeralSessionConfiguration : NSURLSessionConfiguration.defaultSessionConfiguration;
2327
const queue = NSOperationQueue.mainQueue;
2428

2529
function parseJSON(source: string): any {

0 commit comments

Comments
 (0)