Skip to content

Commit

Permalink
proxy by correct method
Browse files Browse the repository at this point in the history
  • Loading branch information
rodnaph committed Dec 7, 2013
1 parent a042c04 commit e8cc937
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nsproxy/http.clj
Expand Up @@ -9,6 +9,11 @@
(:headers req)
["user-agent" "soapaction" "content-type"]))

(defn- req-method [req]
(if (= :post (:request-method req))
http/post
http/get))

(defn- res-body [config req res]
(string/replace
(:body res)
Expand All @@ -27,7 +32,7 @@
opts {:headers (req-headers req)
:content-type "text/xml"
:body (slurp (:body req))}
res (http/post url opts)]
res ((req-method req) url opts)]
(merge
(select-keys res [:status :content-type])
{:body (res-body config req res)})))
Expand Down

0 comments on commit e8cc937

Please sign in to comment.