Last modified: 2014-02-21 22:01:07 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 T50218, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48218 - Investigate how to fake HTTP headers
Investigate how to fake HTTP headers
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Željko Filipin
https://www.google-melange.com/gci/ta...
gci2013 https://www.mediawiki.org/wik...
: easy
: 61379 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-07 16:54 UTC by Željko Filipin
Modified: 2014-02-21 22:01 UTC (History)
4 users (show)

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


Attachments

Description Željko Filipin 2013-05-07 16:54:18 UTC
Zero team uses a HTTP header to fake IPs. Until they implement a different way of faking IPs, investigate if Selenium can fake HTTP headers.
Comment 1 Chris McMahon 2013-05-07 16:58:07 UTC
Probably not with Se directly, see suggestions at https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/TeC-0TVV7Io
Comment 2 Željko Filipin 2013-11-26 18:27:16 UTC
Do we know if Zero team still needs this? Who do we ping there to find out?
Comment 3 Željko Filipin 2013-11-26 18:28:04 UTC
To make it explicit, the solution should use Selenium Ruby bindings: https://code.google.com/p/selenium/wiki/RubyBindings
Comment 5 Yuri Astrakhan 2013-11-26 21:32:59 UTC
We (zero) are currently forced to do testing via our own testing framework (simple script), which is obviously far "superior" to what Selenium offers. We would really like to switch to selenium for testing, but unless we can SET headers on request (we don't care about reading headers in the response), we can't use selenium.

I am aware of the proxying solution, but that is not very applicable - we need to set header = value1, test that results match value1, set it to value2, etc.
Comment 6 Chris McMahon 2013-11-26 21:44:47 UTC
This is the famous Issue 141 https://code.google.com/p/selenium/issues/detail?id=141
Comment 7 Željko Filipin 2013-11-27 18:48:56 UTC
I have changed the title, since it looks to me that this should not be done with Selenium, but another tool.
Comment 8 Željko Filipin 2013-12-02 17:09:45 UTC
If you need more information (and you probably do), feel free to ask questions
here, at #wikimedia-qa freenode IRC channel or at QA mailing list:

https://lists.wikimedia.org/mailman/listinfo/qa
Comment 9 Željko Filipin 2013-12-13 10:53:37 UTC
Looks like it should be possible to fake headers, at least for PhantomJS:

https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#customheaders-object
Comment 10 Željko Filipin 2013-12-13 14:48:57 UTC
More information: http://stackoverflow.com/a/20568647/17469
Comment 11 Željko Filipin 2013-12-13 15:14:11 UTC
The goal of this task is to find out what zero team needs and to implement at least one simple test, proving that the solution you found works.
Comment 12 Željko Filipin 2013-12-13 15:17:17 UTC
Yuri, can you provide more detail?

Mayank (Google Code-in student) is working on this. He needs an example that he will implement.
Comment 13 Yuri Astrakhan 2013-12-13 20:08:23 UTC
We currently built a workaround in production, allowing header values to also be passed as URL params. This is obviously a hack, but has worked more or less ok, as long as we don't test what happens after the click (URL params are not preserved via links)

Here is an example, but this URL ONLY works if you don't have forceHTTPS or other cookies set - use privacy browser when testing:

http://en.m.wikipedia.org/wiki/Special:ZeroRatedMobileAccess?X-CS=-TEST-ALL

That same X-CS could be passed as a header, making testing check if the site shows proper behavior after clicking.

If some other carrier was used, for example X-CS=250-99 -- https://meta.wikimedia.org/wiki/Zero:250-99 -- they only whitelist en & ru, which means navigating to other languages should not show the banner.

Let me know if you have any questions!
Comment 14 Gerrit Notification Bot 2013-12-14 12:05:19 UTC
Change 101485 had a related patch set uploaded by Mayankmadan:
Adding a test to check if supplying custom headers works

https://gerrit.wikimedia.org/r/101485
Comment 15 Željko Filipin 2014-02-14 15:56:21 UTC
*** Bug 61379 has been marked as a duplicate of this bug. ***
Comment 16 Gerrit Notification Bot 2014-02-14 15:58:32 UTC
Change 106709 had a related patch set uploaded by Zfilipin:
Adding Cucumber tests First cucumber test for checking the banners on Wikipedia Zero.

https://gerrit.wikimedia.org/r/106709
Comment 17 Gerrit Notification Bot 2014-02-17 09:32:56 UTC
Change 101485 abandoned by Zfilipin:
WIP: Adding a test to check if supplying custom headers works

Reason:
Moved to https://gerrit.wikimedia.org/r/#/c/106709/

https://gerrit.wikimedia.org/r/101485
Comment 18 Željko Filipin 2014-02-17 12:10:08 UTC
This is now implemented in https://gerrit.wikimedia.org/r/#/c/106709/

Please take a look and merge into ZeroRatedMobileAccess.
Comment 19 Gerrit Notification Bot 2014-02-19 15:20:35 UTC
Change 114153 had a related patch set uploaded by Zfilipin:
Added links for ZeroRatedMobileAccess repository

https://gerrit.wikimedia.org/r/114153
Comment 20 Gerrit Notification Bot 2014-02-19 18:59:22 UTC
Change 106709 merged by jenkins-bot:
The first Selenium test: banners

https://gerrit.wikimedia.org/r/106709
Comment 21 Gerrit Notification Bot 2014-02-19 20:10:54 UTC
Change 114153 merged by jenkins-bot:
Added links for ZeroRatedMobileAccess repository

https://gerrit.wikimedia.org/r/114153

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


Navigation
Links