Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

path-info function for getting path from HttpServletRequest

  • Loading branch information...
commit b99562a255dc82f251f9eaba7cadad808d79e1c1 1 parent f617272
Chris Redinger and Tim Ewald authored
View
9 service/src/io/pedestal/service/http/impl/servlet_interceptor.clj
@@ -134,6 +134,13 @@
(rest names)))
(persistent! out))))
+(defn- path-info [^HttpServletRequest request]
+ (let [path-info (.substring (.getRequestURI request)
+ (.length (.getContextPath request)))]
+ (if (.isEmpty path-info)
+ "/"
+ path-info)))
+
(defn- base-request-map [servlet ^HttpServletRequest servlet-req servlet-resp]
{:server-port (.getServerPort servlet-req)
:server-name (.getServerName servlet-req)
@@ -150,7 +157,7 @@
:servlet-context (.getServletContext ^ServletConfig servlet)
:context-path (.getContextPath servlet-req)
:servlet-path (.getServletPath servlet-req)
- :path-info (.getPathInfo servlet-req)
+ :path-info (path-info servlet-req)
::protocol (.getProtocol servlet-req)
::async-supported? (.isAsyncSupported servlet-req)})
Please sign in to comment.
Something went wrong with that request. Please try again.