r112466 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112465‎ | r112466 | r112467 >
Date:01:37, 27 February 2012
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Make userAgent also work as an option to MWHttpRequest::factory() and MWHttpRequest::__construct(), not just Http::request().
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HttpFunctions.php
@@ -43,9 +43,6 @@
4444 }
4545
4646 $req = MWHttpRequest::factory( $url, $options );
47 - if( isset( $options['userAgent'] ) ) {
48 - $req->setUserAgent( $options['userAgent'] );
49 - }
5047 $status = $req->execute();
5148
5249 if ( $status->isOK() ) {
@@ -210,6 +207,9 @@
211208 } else {
212209 $this->timeout = $wgHTTPTimeout;
213210 }
 211+ if( isset( $options['userAgent'] ) ) {
 212+ $this->setUserAgent( $options['userAgent'] );
 213+ }
214214
215215 $members = array( "postData", "proxy", "noProxy", "sslVerifyHost", "caInfo",
216216 "method", "followRedirects", "maxRedirects", "sslVerifyCert", "callback" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r112467removed superfluous code for setting userAgent since r112466wikinaut01:44, 27 February 2012

Comments

#Comment by Wikinaut (talk | contribs)   01:46, 27 February 2012

ok. Working for example in r112467

Status & tagging log