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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user