Network Extension Location Header Redirect | iOS

Hi, I am wondering if there is a way to get the redirection URL caused by a "Location" header?

A typical example would be when opening an image link from Google Images for Instagram. I cannot post the Google url here as it is not permitted, however if you search "Mr ***** Instagram" on Google Images then open an Instagram link from there it will occur.

I have implemented both the NEFilterDataProvider and NEFilterControlProvider handleNewFlow methods which trigger on the initial request where I get the Google url (full url in the DataProvider and Host and Path in the ControlProvider) so this is working as expected for both Providers. However, this does not trigger when the redirect happens. Which I have seemed to trace back to the location header being returned from Google which then redirects to Instagram.

However, this does not trigger when the redirect happens. Which I have seemed to trace back to the location header being returned from Google which then redirects to Instagram.

This may be because the new redirect task is using the same connection. Check in the logs; CFNetwork should give you some indication such as, "Now using connection x."

Network Extension Location Header Redirect | iOS
 
 
Q