Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed optional params out of order bug. Patch contributed from Zehua …

…Liu.
  • Loading branch information...
commit 2946e9cfa9be9f1a43c7f6dd4306c726930fdf1c 1 parent 5a3efa6
Matt Revelle authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 src/twitter.clj
View
16 src/twitter.clj
@@ -51,12 +51,16 @@ take any required and optional arguments and call the associated Twitter method.
rest-map# (apply hash-map rest#)
provided-optional-params# (set/intersection (set ~optional-params)
(set (keys rest-map#)))
- query-param-names# (sort (map (fn [x#] (keyword (string/replace (name x#) #"-" "_")))
- (concat ~required-params provided-optional-params#)))
- query-params# (apply hash-map (interleave query-param-names#
- (vec (concat ~required-fn-params
- (vals (sort (select-keys rest-map#
- provided-optional-params#)))))))
+ required-query-param-names# (map (fn [x#]
+ (keyword (string/replace (name x#) #"-" "_" )))
+ ~required-params)
+ optional-query-param-names-mapping# (map (fn [x#]
+ [x# (keyword (string/replace (name x#) #"-" "_"))])
+ provided-optional-params#)
+ query-params# (merge (apply hash-map
+ (vec (interleave required-query-param-names# ~required-fn-params)))
+ (apply merge
+ (map (fn [x#] {(second x#) ((first x#) rest-map#)}) optional-query-param-names-mapping#)))
need-to-url-encode# (if (= :get ~req-method)
(into {} (map (fn [[k# v#]] [k# (oauth.signature/url-encode v#)]) query-params#))
query-params#)
Please sign in to comment.
Something went wrong with that request. Please try again.