Last modified: 2014-08-20 19:28:22 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 T68757, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66757 - MWHttpRequest check for noproxy is inverted
MWHttpRequest check for noproxy is inverted
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 23:53 UTC by Mark A. Hershberger
Modified: 2014-08-20 19:28 UTC (History)
3 users (show)

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


Attachments

Description Mark A. Hershberger 2014-06-17 23:53:34 UTC
Bug #44113 claims to address this very statement which now reads

  if ( $this->proxy || !$this->noProxy ) {
     return;

To break this out:

  if (                        # if
       $this->proxy           # the proxy is already set
       ||                     # or
       !$this->noProxy        # noProxy is not set
     ) {
      return;

Instead, it should read "If the proxy is already set or noProxy is set":

  if ( $this->proxy || $this->noProxy ) {
     return;
Comment 1 Gerrit Notification Bot 2014-06-22 23:00:46 UTC
Change 141366 had a related patch set uploaded by devunt:
Use correct condition for MWHttpRequest::proxySetup() function

https://gerrit.wikimedia.org/r/141366
Comment 2 Gerrit Notification Bot 2014-06-23 02:53:14 UTC
Change 141374 had a related patch set uploaded by MarkAHershberger:
Use correct condition for MWHttpRequest::proxySetup() function

https://gerrit.wikimedia.org/r/141374
Comment 3 Gerrit Notification Bot 2014-06-23 02:53:50 UTC
Change 141375 had a related patch set uploaded by MarkAHershberger:
Use correct condition for MWHttpRequest::proxySetup() function

https://gerrit.wikimedia.org/r/141375
Comment 4 Gerrit Notification Bot 2014-06-23 02:54:20 UTC
Change 141376 had a related patch set uploaded by MarkAHershberger:
Use correct condition for MWHttpRequest::proxySetup() function

https://gerrit.wikimedia.org/r/141376
Comment 5 Markus Glaser 2014-06-25 12:30:43 UTC
I think this change affects the logic in a non-intended way. The two conditions produce different results in case a proxy is set and proxy is disabled. In the original logic, the statement results in "false", and the following code is executed. In this proposed change, the proxy is unset, even if it was set before.

The change you are suggesting here leads to the proxy remaining set, if it was set before, even if we have the no proxy flag.

As Aaron Schulz and T.Gries pointed out in bug 44113, the former behaviour is inteded to bypass default settings on local urls.
Comment 6 Mark A. Hershberger 2014-06-25 15:05:59 UTC
The code that this repairs simply doesn't work in my testing.  Granted, I may not be testing correctly, but I'd like to be shown that.

Set up a MW server that can only connect to the outside world via a proxy.  Now, set $wgHTTPProxy so the MW can use the proxy.

Call Http::get( "http://www.google.com" )

The call will fail because noProxy is false by default (meaning, use the proxy!) and so the condition 

 if ( $this->proxy || !$this->noProxy ) {

will be true and setupProxy() will return without setting $this->proxy to $wgHttpProxy.
Comment 7 Gerrit Notification Bot 2014-08-20 19:11:18 UTC
Change 141376 abandoned by Legoktm:
Use correct condition for MWHttpRequest::proxySetup() function

Reason:
Not merged into master yet

https://gerrit.wikimedia.org/r/141376
Comment 8 Gerrit Notification Bot 2014-08-20 19:11:21 UTC
Change 141375 abandoned by Legoktm:
Use correct condition for MWHttpRequest::proxySetup() function

Reason:
Not merged into master yet

https://gerrit.wikimedia.org/r/141375
Comment 9 Gerrit Notification Bot 2014-08-20 19:11:25 UTC
Change 141374 abandoned by Legoktm:
Use correct condition for MWHttpRequest::proxySetup() function

Reason:
Not merged into master yet

https://gerrit.wikimedia.org/r/141374
Comment 10 Kunal Mehta (Legoktm) 2014-08-20 19:28:22 UTC
Clearing backport flag since nothing has been merged into master yet, and the patch has a -2 on it.

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


Navigation
Links