Working towards lein-adl
This commit is contained in:
parent
3b11b678a1
commit
912d417cb6
3 changed files with 88 additions and 90 deletions
|
|
@ -20,14 +20,17 @@
|
|||
;; (for example when using mock requests), then
|
||||
;; .getContextPath might not exist
|
||||
(try (.getContextPath ^ServletContext context)
|
||||
(catch IllegalArgumentException err
|
||||
(log/warn "Failed to initialise servlet-context: " (.getMessage err))
|
||||
context))
|
||||
(catch IllegalArgumentException err
|
||||
(log/warn "Failed to initialise *app-context*: " (.getMessage err))
|
||||
context))
|
||||
;; if the context is not specified in the request
|
||||
;; we check if one has been specified in the environment
|
||||
;; instead
|
||||
(:app-context env))]
|
||||
(handler request))))
|
||||
(do
|
||||
(log/info "Taking '" (:app-context env) "' as *app-context* from env")
|
||||
(:app-context env)))]
|
||||
(log/debug "Using '" *app-context* "' as *app-context*")
|
||||
(handler (assoc request :servlet-context *app-context*)))))
|
||||
|
||||
|
||||
(defn wrap-internal-error [handler]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue