support Connection: keep-alive; misc performance improvements
This commit is contained in:
@ -45,15 +45,14 @@
|
||||
|
||||
(return (get @route-map route)))
|
||||
|
||||
(meth [lru-cache] get-route-by-path [path]
|
||||
(meth get-route-by-path [path]
|
||||
(cond
|
||||
(in path @route-map) (do (get @route-map path))
|
||||
True (do
|
||||
(while (> (.count path "/") 1)
|
||||
(setv path (.join "/" (get (.split path "/") (slice 0 -1))))
|
||||
(when (in (+ path "/*") @route-map)
|
||||
(setv handler (get @route-map (+ path "/*")))
|
||||
(return handler)))
|
||||
(return (get @route-map (+ path "/*")))))
|
||||
|
||||
(always (fn [#* _] (error 404 "not-found)")))))))
|
||||
|
||||
|
Reference in New Issue
Block a user