|
|
@ -424,6 +424,17 @@ func (t *proxyTrie) IsRoot() bool { |
|
|
|
return t.label == rune(0) && t.prefix == "" && t.handler == nil |
|
|
|
} |
|
|
|
|
|
|
|
// Overwrite the handler contained in the specified pattern. If the pattern
|
|
|
|
// doesn't exist, Overwrite returns false.
|
|
|
|
func (t *proxyTrie) Overwrite(pattern string, handler http.Handler) bool { |
|
|
|
node := t.lookup(pattern) |
|
|
|
if node == nil { |
|
|
|
return false |
|
|
|
} |
|
|
|
node.handler = handler |
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|
// Lookup accepts a single pattern string and traverses the radix trie,
|
|
|
|
// returning the handler associated with the pattern or nil if the pattern
|
|
|
|
// cannot be found.
|
|
|
|