ducky/devices

Paddy 2016-01-02 Parent:c24a6c5fcd8c

19:51ad0db105c8 Go to Latest

ducky/devices/vendor/code.secondbit.org/trout.hg/route.go

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.

History
     1.1 --- a/vendor/code.secondbit.org/trout.hg/route.go	Tue Dec 22 06:57:07 2015 -0500
     1.2 +++ b/vendor/code.secondbit.org/trout.hg/route.go	Sat Jan 02 16:08:43 2016 -0800
     1.3 @@ -14,6 +14,7 @@
     1.4  		return
     1.5  	}))
     1.6  	default405Handler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
     1.7 +		w.Header().Set("Allow", strings.Join(r.Header[http.CanonicalHeaderKey("Trout-Methods")], ", "))
     1.8  		w.WriteHeader(http.StatusMethodNotAllowed)
     1.9  		w.Write([]byte("405 Method Not Allowed"))
    1.10  		return
    1.11 @@ -217,7 +218,7 @@
    1.12  func pickNextRoute(b *branch, offset int, input string, variable bool) int {
    1.13  	count := len(b.children)
    1.14  	for i := offset; i < count; i++ {
    1.15 -		if b.children[i].key == input && b.isParam == variable {
    1.16 +		if b.children[i].key == input && b.children[i].isParam == variable {
    1.17  			return i
    1.18  		}
    1.19  	}