Last modified: 2012-02-27 23:50:51 UTC
The project contains four UIWebView requests with a custom HTTP header field. > ... setValue:@"Wikipedia Mobile/2.0" forHTTPHeaderField:@"User_Agent"]; UIWebView's default "User-Agent" field should be enough (see Bug 28884). Otherwise, the "Wikipedia Mobile/2.0" value contains an invalid space character, and an out-of-date version number. There's also an action=opensearch request (using NSURLConnection) without a custom "User-Agent" value. Is the default value suitable? Should the code for creating requests be refactored into a category of NSMutableURLRequest?
Created attachment 8526 [details] +[NSMutableURLRequest(Wikipedia) wikipedia_requestWithURL:] method.
This ain't an in browser XHR request, bug 28884 doesn't apply here - the app should have its own user-agent. It should not use the underlying library's User-Agent. Putting a User_agent header isn't illegal (Well i guess if you get technical non-standardized headers should start with x-) its just rather pointless.
(In reply to comment #2) > This ain't an in browser XHR request, bug 28884 doesn't apply here - the app > should have its own user-agent. It should not use the underlying library's > User-Agent. RootViewController and WikiViewController are using UIWebView to load requests, so the policy for browser-based applications should apply. RootViewController is also using NSURLConnection to request action=opensearch results, but the default User-Agent might be sufficient: <http://stackoverflow.com/questions/1532206/changing-the-useragent-of-nsurlconnection> (I'm not sure how to verify that the app name and version are included by default). > Putting a User_agent header isn't illegal (Well i guess if you get technical > non-standardized headers should start with x-) its just rather pointless. The main issue with the User_Agent strings is the hard-coded version number (it's using "Wikipedia Mobile/2.0", but the current CFBundleVersion is 2.1).
This has now been fixed with the new PhoneGap build.