reorder path checking, priority in internal routes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
68b6f6904b
commit
2aa8768aed
4
http.go
4
http.go
@ -453,12 +453,12 @@ func (h *httpServer) Start() error {
|
|||||||
switch {
|
switch {
|
||||||
case handler == nil && h.hd == nil:
|
case handler == nil && h.hd == nil:
|
||||||
handler = h
|
handler = h
|
||||||
|
case len(h.handlers) > 0 && h.hd != nil:
|
||||||
|
handler = h
|
||||||
case handler == nil && h.hd != nil:
|
case handler == nil && h.hd != nil:
|
||||||
if hdlr, ok := h.hd.Handler().(http.Handler); ok {
|
if hdlr, ok := h.hd.Handler().(http.Handler); ok {
|
||||||
handler = hdlr
|
handler = hdlr
|
||||||
}
|
}
|
||||||
case len(h.handlers) > 0 && h.hd != nil:
|
|
||||||
handler = h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if handler == nil {
|
if handler == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user