ee-soa-transport-rest
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -176,7 +176,18 @@ "use strict"; | ||
, _finishLoading: function(rewrites, environments, callback) { | ||
this.webservice.use(this.hostnames, new FormDataCollector()); | ||
var map = {} | ||
, hosts = []; | ||
// we should not add middlewares twice per domain ... | ||
this.hostnames.forEach(function(hostname) { | ||
if (!map[hostname]) { | ||
map[hostname] = true; | ||
hosts.push(hostname); | ||
} | ||
}.bind(this)); | ||
this.webservice.use(hosts, new FormDataCollector()); | ||
var loader = new Rewrite.loader.InMemoryLoader(rewrites, 'domain'); | ||
this.webservice.use(this.hostnames, new Rewrite.Middleware(loader)); | ||
this.webservice.use(this.hostnames, new Parser.Middleware()); | ||
this.webservice.use(hosts, new Rewrite.Middleware(loader)); | ||
this.webservice.use(hosts, new Parser.Middleware()); | ||
@@ -186,4 +197,4 @@ var map = new maps.CompoundMatchingMap(environments); | ||
this.webservice.use(this.hostnames, templating); | ||
this.webservice.use(this.hostnames, this); | ||
this.webservice.use(hosts, templating); | ||
this.webservice.use(hosts, this); | ||
@@ -190,0 +201,0 @@ this.isLoaded = true; |
{ | ||
"name" : "ee-soa-transport-rest" | ||
, "description" : "Rest specific transport implementation." | ||
, "version" : "0.2.3" | ||
, "version" : "0.2.4" | ||
, "homepage" : "https://github.com/eventEmitter/ee-soa-transport-rest" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael Rüfenacht <ruefe@rcky.ch> (http://rcky.ch/)" |
62698
1524