File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 22 (:use [clojure.contrib.java-utils :only [as-str]]
33 [clojure.contrib.duck-streams :only [read-lines]]
44 [clojure.contrib.str-utils :only [str-join]])
5- (:import (java.net URL HttpURLConnection URLEncoder))))
5+ (:import (java.net URL HttpURLConnection URLEncoder)
6+ (java.io StringReader)))
67
78(def default-headers {" User-Agent" (str " Clojure/" (clojure-version )
89 " (+http://clojure.org)" ),
@@ -27,9 +28,10 @@ url as its sole argument."
2728 " Returns a lazy-seq of lines from either the input stream
2829or the error stream of connection, whichever is appropriate."
2930 [connection]
30- (read-lines (if (>= (.getResponseCode connection) 400 )
31- (.getErrorStream connection)
32- (.getInputStream connection))))
31+ (read-lines (or (if (>= (.getResponseCode connection) 400 )
32+ (.getErrorStream connection)
33+ (.getInputStream connection))
34+ (StringReader. " " ))))
3335
3436(defn- parse-headers
3537 " Returns a map of the response headers from connection."
You can’t perform that action at this time.
0 commit comments