1. Cloud Horizon
  2. Untitled project
  3. devproxy

Commits

Branko Vukelic  committed 019fffd

Fixed bug

  • Participants
  • Parent commits a535dfe
  • Branches master

Comments (0)

Files changed (1)

File lib/proxy.js

View file
   return '/';
 };
 
+// Keep track of hostnames
+var hosts = [];
+
 var mkService = function (target, root) {
   target = url.parse(target); 
   root = reSlash(root || target.path);
+
+  hosts.push(target.hostname);
+
   return {
     target: {
       host: target.hostname,
 });
 
 proxyServer.proxy.on('start', function(req, res, target) {
-  if (target.host === service.target.host) {
+  if (hosts.indexOf(target.host) > -1) {
     if (conf.noLang) {
       // Remove accept-language to prevent i18n-related redirects
       delete req.headers['accept-language'];