Search code examples
iosuiwebviewnsurlconnectionlinkedin-apinsurlprotocol

UIWebView + NSUrlConnection - LinkedIn stuck in an Infinite Loop


I'm trying to create a WebView App on iOS to intercept all URL requests for some logging purposes.

For this, I wrote a class that extends NSUrlProtocol & and loads requests using NSUrlConnection following this tutorial:

http://www.raywenderlich.com/59982/nsurlprotocol-tutorial

Gmail works fine in this. But LinkedIn gets stuck in an infinite loop (continuous 302 requests) after entering User ID & Password.

I checked this infinite loop using an intermediate web debugging proxy.

Please note that this infinite loop is different from the one mentioned in the first part of the tutorial, which I have addressed in the same as as mentioned in the tutorial.

If I don't register my NSUrlProtocol derived class, linked in works fine.

Any help would be appreciated. Let me know if you need any more info/code etc.


Solution

  • Nevermind this.. It was a weird issue from LinkedIn itself.

    I changed the initial URL from http://www.linkedin.com to http://touch.www.linkedin.com and it started working..