`canInitWithRequest` not called in Xcode 15

76 Views Asked by At

We're currently using PINRemoteImage as an image loader and also OHHTTPStubs to mock network requests for testing. All of this was working perfectly fine in Xcode 14, but image stubbing fails to work in Xcode 15.

I've checked and all other stubbing in Xcode 15, and all bog standard network requests where we just use NSURLSession are still able to be stubbed no problem.

On digging in a little, we found that the function + (BOOL)canInitWithRequest:(NSURLRequest *)request; in NSURLProtocol is no longer called by PINRemoteImage when it's loading an image in Xcode 15, but it is in Xcode 14. This is a critical step in being able to stub network requests as it's how OHHTTPStubs gets setup.

I've posted on both the repos for PINRemoteImage and OHHTTPStubs but I'm not hopeful about getting a response.

I'm curious to see if anyone knows of any underlying changes made to NSURLSession with Xcode 15 that would cause this effect?

Any help appreciated.

0

There are 0 best solutions below