Skip to content

Commit

Permalink
loader: don't hard-code mainRouter in loadApps
Browse files Browse the repository at this point in the history
This was causing a new test to fail, as it could not properly load APIs
on a custom muxer. This was simply never spotted as loadApps is always
passed mainRouter in the production code.
  • Loading branch information
mvdan authored and buger committed Nov 10, 2017
1 parent d219e79 commit 413f585
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion api_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func createDefinitionFromString(defStr string) *APISpec {
loader := APIDefinitionLoader{}
def := loader.ParseDefinition(strings.NewReader(defStr))
spec := loader.MakeSpec(def)
spec.APIDefinition = def
return spec
}

Expand Down
2 changes: 1 addition & 1 deletion api_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func loadApps(specs []*APISpec, muxer *mux.Router) {
"api_name": spec.Name,
"domain": spec.Domain,
}).Info("Custom Domain set.")
subrouter = mainRouter.Host(spec.Domain).Subrouter()
subrouter = subrouter.Host(spec.Domain).Subrouter()
}
chainObj := processSpec(spec, apisByListen, redisStore, redisOrgStore, healthStore, rpcAuthStore, rpcOrgStore, subrouter)
chainObj.Index = i
Expand Down

0 comments on commit 413f585

Please sign in to comment.