diff --git a/project.clj b/project.clj index bde89ff..3e137a6 100644 --- a/project.clj +++ b/project.clj @@ -1,8 +1,9 @@ -(defproject tailrecursion/ring-proxy "2.0.0-SNAPSHOT" +(defproject tailrecursion/ring-proxy "4.0.2-FINAL" :description "HTTP proxy ring middleware for Clojure web applications." :url "https://github.com/tailrecursion/ring-proxy" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.4.0"] [ring/ring-core "1.1.8"] - [clj-http "0.6.5"]]) + [clj-http "0.6.5"]] +:repositories [["releases" {:url "http://nexus-dev.snc1/content/repositories/releases/" :sign-releases false}]]) diff --git a/src/tailrecursion/ring_proxy.clj b/src/tailrecursion/ring_proxy.clj index dfe5c1a..631b50e 100644 --- a/src/tailrecursion/ring_proxy.clj +++ b/src/tailrecursion/ring_proxy.clj @@ -16,10 +16,7 @@ (defn slurp-binary "Reads len bytes from InputStream is and returns a byte array." [^java.io.InputStream is len] - (with-open [rdr is] - (let [buf (byte-array len)] - (.read rdr buf) - buf))) + (slurp is)) (defn wrap-proxy "Proxies requests to proxied-path, a local URI, to the remote URI at @@ -35,7 +32,7 @@ (subs (:uri req) (.length proxied-path))) nil nil)] - (-> (merge {:method (:request-method req) + (-> (merge-with merge {:method (:request-method req) :url (str remote-uri "?" (:query-string req)) :headers (dissoc (:headers req) "host" "content-length") :body (if-let [len (get-in req [:headers "content-length"])]