Thanks! I really hope apple sorts this out. I made a bunch or experiments with server side CORS related headers, and also - just to make sure - tried to hit some 3ty party open api endpoints ( to be sure that it’s not a server side CORS problem ) and the result is the same. So, probably iOS 15 and/or WebKit realted … for now I think I’ll go back to previous version, and hope that I’ll be able to use angular’s http client, because if I have to switch to ionic-native or capacitor http, then it will be a real pain
here’s a simple code snippet if anyone wants to test. just create a blank ionic project, compile it and test it on ios 15 beta
import { HttpClient } from '@angular/common/http'
...
test() {
this.httpclient.get('https://jsonplaceholder.typicode.com/users/1').subscribe({
next: (data)=>{
console.log(data);
},
error: (err)=>{
console.error(err);
}});
}
result in xcode debug console:
⚡️ [error] - {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"https://jsonplaceholder.typicode.com/users/1","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://jsonplaceholder.typicode.com/users/1: 0 Unknown Error","error":{"isTrusted":true}}
I did get a different result in system logs so
error in system console:
default 21:58:11.776071+0200 com.apple.WebKit.Networking 0x103128000 - [webProcessIdentifier=4] NetworkConnectionToWebProcess::scheduleResourceLoad: (parentPID=897, pageProxyID=5, webPageID=6, frameID=3, resourceID=24)
default 21:58:11.776272+0200 com.apple.WebKit.Networking 0x103128000 - [webProcessIdentifier=4] NetworkConnectionToWebProcess::resolveBlobReferences: (parentPID=897, pageProxyID=5, webPageID=6, frameID=3, resourceID=24)
default 21:58:11.776361+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::startWithServiceWorker:
default 21:58:11.776408+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::serviceWorkerDidNotHandle: (fetchIdentifier=0)
default 21:58:11.776477+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::start: hasNetworkLoadChecker=1
default 21:58:11.776559+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::start: NetworkLoadChecker::check is done
default 21:58:11.776632+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::retrieveCacheEntry: isMainFrameLoad=0
default 21:58:11.776704+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::retrieveCacheEntry: Checking the HTTP disk cache
default 21:58:11.777667+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::retrieveCacheEntry: Done checking the HTTP disk cache (foundCachedEntry=1)
default 21:58:11.777761+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::retrieveCacheEntryInternal:
default 21:58:11.777832+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::retrieveCacheEntryInternal: Cached entry needs revalidation
default 21:58:11.777901+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::validateCacheEntry:
default 21:58:11.777956+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::startNetworkLoad: (isFirstLoad=1, timeout=2147483647.000000)
default 21:58:11.778007+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> resuming, timeouts(2147483647.0, 604800.0) QOS(0x19) Voucher (null)
default 21:58:11.778459+0200 com.apple.WebKit.Networking [Telemetry]: Activity <nw_activity 12:2 [4EA69AD6-5F62-451B-8100-F8D3880F4BE5] (reporting strategy default)> on Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> was not selected for reporting
default 21:58:11.778552+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::startNetworkLoad: Going to the network (description=LocalDataTask <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6>)
default 21:58:11.779129+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> {strength 0, tls 4, ct 0, sub 0, sig 1, ciphers 0, bundle 0, builtin 0}
default 21:58:11.779407+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> now using Connection 2
default 21:58:11.779848+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> sent request, body N 0
default 21:58:11.838782+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> received response, status 304 content U
default 21:58:11.838938+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> done using Connection 2
default 21:58:11.839320+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> response ended
default 21:58:11.839762+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didReceiveResponse: (httpStatusCode=304, MIMEType=, expectedContentLength=-1, hasCachedEntryForValidation=1, hasNetworkLoadChecker=1)
default 21:58:11.839870+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didReceiveResponse: Received revalidation response (validationSucceeded=1, wasOriginalRequestConditional=0)
default 21:58:11.840219+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> summary for task success {transaction_duration_ms=61, response_status=304, connection=2, reused=1, request_start_ms=0, request_duration_ms=0, response_start_ms=59, response_duration_ms=0, request_bytes=57, response_bytes=293, cache_hit=0}
default 21:58:11.840320+0200 com.apple.WebKit.Networking Task <489CAB19-6348-4CE9-8B24-34FD50B59F1F>.<6> finished successfully
default 21:58:11.840821+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didFinishLoading: (numBytesReceived=0, hasCacheEntryForValidation=1)
default 21:58:11.840890+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didRetrieveCacheEntry:
error 21:58:11.841238+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didRetrieveCacheEntry: Failing load due to NetworkLoadChecker::validateResponse
error 21:58:11.841314+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::didFailLoading: (wasServiceWorkerLoad=0, isTimeout=0, isCancellation=0, isAccessControl=1, errorCode=0)
default 21:58:11.841428+0200 com.apple.WebKit.Networking 0x10334e080 - [pageProxyID=5, webPageID=6, frameID=3, resourceID=24, isMainResource=0, destination=0, isSynchronous=0] NetworkResourceLoader::cleanup: (result=2)
default 21:58:16.787166+0200 com.apple.WebKit.Networking automatic index on z(sourceDomainID)
same code run on ios 13 for example results:
⚡️ [log] - {"id":1,"name":"Leanne Graham","username":"Bret","email":"Sincere@april.biz","address":{"street":"Kulas Light","suite":"Apt. 556","city":"Gwenborough","zipcode":"92998-3874","geo":{"lat":"-37.3159","lng":"81.1496"}},"phone":"1-770-736-8031 x56442","website":"hildegard.org","company":{"name":"Romaguera-Crona","catchPhrase":"Multi-layered client-server neural-net","bs":"harness real-time e-markets"}}