Last modified: 2012-02-27 23:50:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30905, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28905 - User agent strings (for UIWebView and NSURLConnection requests) need to be updated
User agent strings (for UIWebView and NSURLConnection requests) need to be up...
Status: RESOLVED FIXED
Product: Wikipedia App
Classification: Unclassified
Generic (Other open bugs)
1.0.0 (Android)
Other other
: Normal trivial
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 33673
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-10 01:27 UTC by Ben Rimmington
Modified: 2012-02-27 23:50 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: iOS
Assignee Huggle Beta Tester: ---


Attachments
+[NSMutableURLRequest(Wikipedia) wikipedia_requestWithURL:] method. (553 bytes, text/plain)
2011-05-10 01:53 UTC, Ben Rimmington
Details

Description Ben Rimmington 2011-05-10 01:27:40 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?
Comment 1 Ben Rimmington 2011-05-10 01:53:16 UTC
Created attachment 8526 [details]
+[NSMutableURLRequest(Wikipedia) wikipedia_requestWithURL:] method.
Comment 2 Bawolff (Brian Wolff) 2011-05-31 03:19:48 UTC
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.
Comment 3 Ben Rimmington 2011-05-31 10:30:08 UTC
(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).
Comment 4 Tomasz Finc 2012-02-27 23:50:51 UTC
This has now been fixed with the new PhoneGap build.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links