ducky/devices
19:51ad0db105c8 Browse Files
Update trout to fix routing bug. Update to tip on trout to fix the routing bug that was causing us such issues. See the commit message of trout at 3df515f0cec5 for more details.
Godeps/Godeps.json vendor/code.secondbit.org/trout.hg/route.go
1.1 --- a/Godeps/Godeps.json Tue Dec 22 06:57:07 2015 -0500 1.2 +++ b/Godeps/Godeps.json Sat Jan 02 16:08:43 2016 -0800 1.3 @@ -27,8 +27,8 @@ 1.4 }, 1.5 { 1.6 "ImportPath": "code.secondbit.org/trout.hg", 1.7 - "Comment": "null-3", 1.8 - "Rev": "'b966f38379ddb51f07e8adeb121599e107998409'" 1.9 + "Comment": "null-4", 1.10 + "Rev": "'3df515f0cec542cfda6527cc2b9530fc91d7198f'" 1.11 }, 1.12 { 1.13 "ImportPath": "code.secondbit.org/uuid.hg",
2.1 --- a/vendor/code.secondbit.org/trout.hg/route.go Tue Dec 22 06:57:07 2015 -0500 2.2 +++ b/vendor/code.secondbit.org/trout.hg/route.go Sat Jan 02 16:08:43 2016 -0800 2.3 @@ -14,6 +14,7 @@ 2.4 return 2.5 })) 2.6 default405Handler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 2.7 + w.Header().Set("Allow", strings.Join(r.Header[http.CanonicalHeaderKey("Trout-Methods")], ", ")) 2.8 w.WriteHeader(http.StatusMethodNotAllowed) 2.9 w.Write([]byte("405 Method Not Allowed")) 2.10 return 2.11 @@ -217,7 +218,7 @@ 2.12 func pickNextRoute(b *branch, offset int, input string, variable bool) int { 2.13 count := len(b.children) 2.14 for i := offset; i < count; i++ { 2.15 - if b.children[i].key == input && b.isParam == variable { 2.16 + if b.children[i].key == input && b.children[i].isParam == variable { 2.17 return i 2.18 } 2.19 }