Permalink
Browse files

Add a facility to disable auto redirect-follow.

  • Loading branch information...
1 parent 107e68a commit ab4c510847181121ee5ac08be062869ecfe954d4 @ghoseb ghoseb committed with ghoseb Jun 15, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/clojure_http/client.clj
@@ -17,6 +17,8 @@
(def *buffer-size* 1024)
+(def *follow-redirects* true)
+
(defn set-system-proxy!
"Java's HttpURLConnection cannot do per-request proxying. Instead,
system properties are used. This function mutates the global setting.
@@ -126,7 +128,8 @@ by a server."
"GET")))]
(.setRequestMethod connection method)
(.setConnectTimeout connection *connect-timeout*)
-
+ (.setInstanceFollowRedirects connection *follow-redirects*)
+
(doseq [[header value] (conj default-headers (or headers {}))]
;; Treat Cookie specially -- see below.
(when (not (= header "Cookie"))

0 comments on commit ab4c510

Please sign in to comment.