Skip to content

Commit

Permalink
Adjust some minor things to make bikeshed happier
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Apr 23, 2015
1 parent 994411d commit 0747b9b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/clj_http/client.clj
Expand Up @@ -484,11 +484,11 @@
headers))

(defn wrap-additional-header-parsing
"Middleware that parses additional http headers from the body of a
web page, adding them into the headers map of the response if any
are found. Only looks at the body if the :decode-body-headers option
is set to a truthy value. Will be silently disabled if crouton is excluded
from clj-http's dependencies. Will do nothing if no body is returned, e.g. HEAD requests"
"Middleware that parses additional http headers from the body of a web page,
adding them into the headers map of the response if any are found. Only looks
at the body if the :decode-body-headers option is set to a truthy value. Will
be silently disabled if crouton is excluded from clj-http's dependencies. Will
do nothing if no body is returned, e.g. HEAD requests"
[client]
(fn [req]
(let [resp (client req)]
Expand Down
1 change: 1 addition & 0 deletions src/clj_http/cookies.clj
@@ -1,4 +1,5 @@
(ns clj-http.cookies
"Namespace dealing with HTTP cookies"
(:require [clj-http.util :refer [opt]]
[clojure.string :refer [blank? join lower-case]])
(:import (org.apache.http.client.params ClientPNames CookiePolicy)
Expand Down
7 changes: 4 additions & 3 deletions src/clj_http/core.clj
Expand Up @@ -11,7 +11,8 @@
HttpEntityEnclosingRequest
HttpResponse Header HttpHost
HttpResponseInterceptor)
(org.apache.http.auth UsernamePasswordCredentials AuthScope NTCredentials)
(org.apache.http.auth UsernamePasswordCredentials AuthScope
NTCredentials)
(org.apache.http.params CoreConnectionPNames)
(org.apache.http.client HttpClient HttpRequestRetryHandler)
(org.apache.http.client.methods HttpDelete
Expand Down Expand Up @@ -213,8 +214,8 @@
[{:keys [request-method scheme server-name server-port uri query-string
headers body multipart socket-timeout conn-timeout proxy-host
proxy-ignore-hosts proxy-port proxy-user proxy-pass as cookie-store
retry-handler response-interceptor digest-auth ntlm-auth connection-manager
client-params]
retry-handler response-interceptor digest-auth ntlm-auth
connection-manager client-params]
:as req}]
(let [^ClientConnectionManager conn-mgr
(or connection-manager
Expand Down
3 changes: 2 additions & 1 deletion src/clj_http/links.clj
@@ -1,4 +1,5 @@
(ns clj-http.links)
(ns clj-http.links
"Namespace dealing with HTTP link headers")

(def ^:private quoted-string
#"\"((?:[^\"]|\\\")*)\"")
Expand Down
3 changes: 2 additions & 1 deletion test/clj_http/test/client.clj
Expand Up @@ -636,7 +636,8 @@
new-client (client/wrap-additional-header-parsing client)
resp (new-client {:decode-body-headers true})
resp2 (new-client {:decode-body-headers false})
resp3 ((client/wrap-additional-header-parsing (fn [req] {:body nil})) {:decode-body-headers true})]
resp3 ((client/wrap-additional-header-parsing
(fn [req] {:body nil})) {:decode-body-headers true})]
(is (= {"content-type" "text/html; charset=Shift_JIS"
"content-style-type" "text/css"
"content-script-type" "text/javascript"}
Expand Down

0 comments on commit 0747b9b

Please sign in to comment.