File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
ring-servlet/src/ring/util Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 8
8
HttpServletRequest
9
9
HttpServletResponse]))
10
10
11
- (defn- get-headers
12
- " Creates a name/value map of all the request headers."
13
- [^HttpServletRequest request]
11
+ (defn- get-headers [^HttpServletRequest request]
14
12
(reduce
15
13
(fn [headers, ^String name]
16
14
(assoc headers
21
19
{}
22
20
(enumeration-seq (.getHeaderNames request))))
23
21
24
- (defn- get-content-length
25
- " Returns the content length, or nil if there is no content."
26
- [^HttpServletRequest request]
22
+ (defn- get-content-length [^HttpServletRequest request]
27
23
(let [length (.getContentLength request)]
28
24
(when (>= length 0 ) length)))
29
25
30
- (defn- get-client-cert
31
- " Returns the SSL client certificate of the request, if one exists."
32
- [^HttpServletRequest request]
26
+ (defn- get-client-cert [^HttpServletRequest request]
33
27
(first (.getAttribute request " javax.servlet.request.X509Certificate" )))
34
28
35
29
(defn build-request-map
64
58
:servlet-context (.getServletContext servlet)
65
59
:servlet-context-path (.getContextPath request)}))
66
60
67
- (defn- set-headers
68
- " Update a HttpServletResponse with a map of headers."
69
- [^HttpServletResponse response, headers]
61
+ (defn- set-headers [^HttpServletResponse response, headers]
70
62
(doseq [[key val-or-vals] headers]
71
63
(if (string? val-or-vals)
72
64
(.setHeader response key val-or-vals)
You can’t perform that action at this time.
0 commit comments