Location / must be the last one

This commit is contained in:
Manuel de Brito Fontes 2016-05-04 08:56:03 -03:00
parent 7e8c051e2c
commit 3e3de84836

View file

@ -88,12 +88,13 @@ type Location struct {
}
// LocationByPath sorts location by path
// Location / is the last one
type LocationByPath []*Location
func (c LocationByPath) Len() int { return len(c) }
func (c LocationByPath) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c LocationByPath) Less(i, j int) bool {
return c[i].Path < c[j].Path
return c[i].Path > c[j].Path
}
// NewDefaultServer return an UpstreamServer to be use as default server that returns 503.