aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-11-26 22:42:01 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-11-26 22:42:01 +0000
commit5c416202f4897e04d8f5eadc0457b86ca643e716 (patch)
tree22faa072ae3f067443e4c060cdec97d6c0a692f7
parent185365628b3088f77713e569c3390898b7848c22 (diff)
Don't do this patch when POSTing
-rw-r--r--sx-method.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/sx-method.el b/sx-method.el
index 238f46a..4810e8c 100644
--- a/sx-method.el
+++ b/sx-method.el
@@ -76,8 +76,12 @@ Return the entire response as a complex alist."
(format "/%s" id))
(when submethod
(format "/%s" submethod))
- (when (stringp site)
- (format "?site=%s" site))))
+ ;; On GET methods site is buggy, so we
+ ;; need to provide it as a url argument.
+ (when (and site (string= url-method "GET"))
+ (prog1
+ (format "?site=%s" site)
+ (setq site nil)))))
(call 'sx-request-make))
(lwarn "sx-call-method" :debug "A: %S T: %S. M: %S,%s. F: %S" (equal 'warn auth)
access-token method-auth full-method filter-auth)
@@ -100,6 +104,8 @@ Return the entire response as a complex alist."
(setq parameters
(cons (cons 'filter (sx-filter-get-var filter))
keywords))
+ (when site
+ (setq parameters (cons (cons 'site site) parameters)))
(funcall call
full-method
parameters