Skip to content

Commit

Permalink
More thorough anchoring for test domain replacements in web.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gwicke committed Dec 31, 2014
1 parent a7bbe77 commit ac96275
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/filters/global/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ var preq = require('preq');
function handleAll (restbase, req) {

// some tests use a fake en.wikipedia.test.local domain, which will confuse
// external services such as parsoid and api.php -- if found here, replace
// external services such as parsoid and api.php -- if found here, replace
// with en.wikipedia.org
req.uri = req.uri.replace(/\/en.wikipedia.test.local\//, '/en.wikipedia.org/');
req.uri = req.uri.replace(/^http:\/\/en\.wikipedia\.test\.local\//,
'http://en.wikipedia.org/')
.replace(/^http:\/\/parsoid-lb\.eqiad\.wikimedia\.org\/v2\/en\.wikipedia\.test\.local\//,
'http://parsoid-lb.eqiad.wikimedia.org/v2/en.wikipedia.org/');

if (restbase._options.conf.offline) {
throw new Error("We are offline, you are tring to fallback to dynamic api");
Expand Down

0 comments on commit ac96275

Please sign in to comment.