Add support for Host matching in HTTP triggers (#425)

Include Host in httptrigger output table and fix duplicate error detection to consider Host as well.
This commit is contained in:
Adam Bouhenguel
2017-12-11 01:22:05 -06:00
committed by Soam Vasani
parent dff34b08e9
commit be84a864fb
3 changed files with 11 additions and 6 deletions
+6 -1
View File
@@ -116,7 +116,12 @@ func (ts *HTTPTriggerSet) getRouter() *mux.Router {
function: rr.functionMetadata,
executor: ts.executor,
}
muxRouter.HandleFunc(trigger.Spec.RelativeURL, fh.handler).Methods(trigger.Spec.Method)
ht := muxRouter.HandleFunc(trigger.Spec.RelativeURL, fh.handler)
ht.Methods(trigger.Spec.Method)
if trigger.Spec.Host != "" {
ht.Host(trigger.Spec.Host)
}
if trigger.Spec.RelativeURL == "/" && trigger.Spec.Method == "GET" {
homeHandled = true
}