trout

Paddy 2016-01-02 Parent:bf38b050b6c4

3:3df515f0cec5 Go to Latest

trout/trie.go

Fix bug in handling of finding closest match for params. We had a bug that finding the closest match for params would only work if the parent was also a param. This lead to problems where multiple methods declared on a single endpoint as follows were treated as multiple endpoints: router.Endpoint("/{id}").Methods("GET").Handler(handleGet) router.Endpoint("/{id}").Methods("POST").Handler(handlePost) This caused erroneous Method Not Allowed errors, as the POST method would be part of an Endpoint that could never be routed to. We also discovered that Method Not Allowed errors weren't returning the required Allow header with a list of acceptable methods, so this has been fixed.

History