Does UIWebView pass on referral information? If a user clicks a link to my server and my server immediately redirects the request to a second server. Will the second server see the referral page? What's the default behavior? If that information is pass to the second server, how can I prevent that?
A:
The default behavior for any HTTP agent, including Safari, is to add the Referer HTTP header, upon receiving a redirect response.
You can try implementing the UIWebViewDelegate protocol and listening to the webView:shouldStartLoadWithRequest:navigationType: message. when you get the message (assuming UIWebView will sent it for redirects), you can examine the headers collection of the NSURLRequest instance and if it contains Referer header, you can try removing it. I haven't tried it, though, and it might turn out the headers collection is read-only.
Franci Penov
2010-07-24 07:59:56
what if I pass the parameters from the app to server 1 in POST method. then server 1 redirects app to server 2. server 2 won't see the parameters passed in the first request right?
Fasid
2010-07-24 10:01:32
That is correct. The body of post request will not be seen by the second server.
Franci Penov
2010-07-24 11:29:56