From: Antoine Musso Date: Tue, 20 Dec 2016 15:46:20 +0000 (+0100) Subject: build: Karma proxy should convert Host header X-Git-Tag: 1.31.0-rc.0~4477^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=3409dc52723d63b790756762ec01c7f137a30440;p=lhc%2Fweb%2Fwiklou.git build: Karma proxy should convert Host header By default the Karma proxy does requests against 'localhost', however if the target wiki server has strict host validation (e.g. multiple virtual hosts or otherwise strictly verified) then requests may fail since load.php is not found. An example is with MW_SERVER=devwiki.local. MediaWiki-Vagrant and Wikimedia CI are not affected since they use 'localhost' as the virtual host. Set Karma proxy to change the hostname accordingly. Reference: https://github.com/karma-runner/karma/issues/1729 https://github.com/karma-runner/karma/commit/ae05ea4 Bug: T153757 Change-Id: I317d5686aecd1fb6cf6921cdca77670cded85607 --- diff --git a/Gruntfile.js b/Gruntfile.js index 55b7932f00..7b3af54c95 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,10 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-karma' ); grunt.loadNpmTasks( 'grunt-stylelint' ); - karmaProxy[ wgScriptPath ] = wgServer + wgScriptPath; + karmaProxy[ wgScriptPath ] = { + target: wgServer + wgScriptPath, + changeOrigin: true + }; grunt.initConfig( { eslint: {