Page MenuHomePhabricator

Karma qunit proxy fails setting Host: header
Closed, ResolvedPublic

Description

On my local machine Karma proxy the requests to localhost which is not a configured virtual host, thus it fails to grab materials from /load.php.

Configuring the proxy with changeOrigin: true fix it for me. From their documentation:

The proxy can be specified directly by the target url or path, or with an object to configure more options. The available options are:
target The target url or path (mandatory)
changeOrigin Whether or not the proxy should override the Host header using the host from the target (default false)

References:

https://github.com/karma-runner/karma/issues/1729
https://github.com/karma-runner/karma/commit/ae05ea4

It is not an issue on MediaWiki Vagrant or Wikimedia CI which both use 'localhost' as a virtual host.