Last modified: 2011-12-06 01:27:59 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 T24179, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22179 - Internal use of API (FauxRequest) results in HTTP headers being set
Internal use of API (FauxRequest) results in HTTP headers being set
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.15.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-20 04:17 UTC by Jim
Modified: 2011-12-06 01:27 UTC (History)
6 users (show)

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


Attachments

Description Jim 2010-01-20 04:17:15 UTC
Discussion can be found here: http://toolserver.org/~mwbot/logs/%23mediawiki/20100119.txt (search for "openbip")

I'm creating new tags using the MediaWiki API internally (http://www.mediawiki.org/wiki/API:Calling_internally) via FauxRequest.

Some of these tags create new wiki pages automatically.  When save (or preview) a page with one of these tags, instead of seeing the updated page (or the preview of the updated page), my browser redirects to one of the newly-created pages.

Thus, it seems that using the MediaWiki API, even internally, results in HTTP headers being set.
Comment 1 Chad H. 2010-01-20 13:03:03 UTC
For what it's worth, the header() calls in the API seem to be suppressed by using FauxRequest, so I'm not sure it's within the API itself. It would be nice if all calls to header() use the wrapper WebResponse::header() so we can handle this "send headers or not" condition in one place.
Comment 2 Jim 2010-01-20 16:53:27 UTC
Some more information:

I'm testing with Page1, which contains a tag that creates Page2, edits Page2, and then adds a new section to Page2.

When viewing Page1, instead of seeing Page1, I see Page2.  But some more information on that:
  1.  It is the /last/ API-result that is showing up in my browser.  i.e. in the above example, my browser (Firefox and Chrome) is specifically going to the new section I added.  i.e. The address bar shows: http://...../mediawiki-1.15.1/index.php/Page2#NewSection
  2.  In my tag implementation, I tried printing out headers_list() after each API call.  In each case I got:
Array
(
    [0] => X-Powered-By: PHP/5.3.1
)

I'm not 100% sure it's a redirect yet ... but since the URL in the browser is changing I assume it's a redirect.
Comment 3 Sam Reed (reedy) 2011-06-05 19:52:42 UTC
(In reply to comment #1)
> For what it's worth, the header() calls in the API seem to be suppressed by
> using FauxRequest, so I'm not sure it's within the API itself. It would be nice
> if all calls to header() use the wrapper WebResponse::header() so we can handle
> this "send headers or not" condition in one place.

r89528
Comment 4 Sam Reed (reedy) 2011-06-05 19:58:28 UTC
(In reply to comment #0)
> Discussion can be found here:
> http://toolserver.org/~mwbot/logs/%23mediawiki/20100119.txt (search for
> "openbip")
> 
> I'm creating new tags using the MediaWiki API internally
> (http://www.mediawiki.org/wiki/API:Calling_internally) via FauxRequest.
> 
> Some of these tags create new wiki pages automatically.  When save (or preview)
> a page with one of these tags, instead of seeing the updated page (or the
> preview of the updated page), my browser redirects to one of the newly-created
> pages.
> 
> Thus, it seems that using the MediaWiki API, even internally, results in HTTP
> headers being set.

Do you have something I can test this on? Else, can you see what occurs on trunk as of r89528?

Thanks!
Comment 5 Sam Reed (reedy) 2011-06-05 20:00:28 UTC
I do wonder if we'll need to header_remove( "X-Powered-By" ) or something...

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


Navigation
Links