Merge pull request #79 from fission/router-handle-method-bug

Bug fix for handling a route's HTTP method in router
This commit is contained in:
Soam Vasani
2017-01-17 22:27:44 -08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ func (ts *HTTPTriggerSet) getRouter() *mux.Router {
Function: m,
poolmgr: ts.poolmgr,
}
muxRouter.HandleFunc(trigger.UrlPattern, fh.handler)
muxRouter.HandleFunc(trigger.UrlPattern, fh.handler).Methods(trigger.Method)
}
// Internal triggers for (the latest version of) each function
+1 -1
View File
@@ -35,7 +35,7 @@ func TestRouter(t *testing.T) {
triggers := makeHTTPTriggerSet(fmap, nil, nil)
triggerUrl := "/foo"
triggers.triggers = append(triggers.triggers, fission.HTTPTrigger{UrlPattern: triggerUrl, Function: *fn})
triggers.triggers = append(triggers.triggers, fission.HTTPTrigger{UrlPattern: triggerUrl, Function: *fn, Method: "GET"})
port := 4242
go serve(port, triggers)