Permalink
Browse files

Fix for bodies with more than one param

  • Loading branch information...
1 parent d9e0cb7 commit 32e206cdcf36ad8293f614163a2b20323ca387b7 @gregspurrier committed Jan 31, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/oauth/util.clj
  2. +3 −1 test/oauth/test/util.clj
View
@@ -106,7 +106,7 @@
[request]
(if-let [body (:body request)]
(let [body (if (byte-array? body) (String. body) (str body))]
- (-> (apply hash-map (split body #"="))
+ (-> (apply hash-map (split body #"[=&]"))
(transform-values url-decode)))))
(defn percent-encode
View
@@ -87,7 +87,9 @@
twitter-update-status
{"status" "Hello Ladies + Gentlemen, a signed OAuth request!"}
(assoc twitter-update-status :body (.getBytes (:body twitter-update-status)))
- {"status" "Hello Ladies + Gentlemen, a signed OAuth request!"}))
+ {"status" "Hello Ladies + Gentlemen, a signed OAuth request!"}
+ (assoc twitter-update-status :body "x=foo&y=bar")
+ {"x" "foo" "y" "bar"}))
(deftest test-random-base64
(is (string? (random-base64 1)))

0 comments on commit 32e206c

Please sign in to comment.