copy/paste drakma::alist-to-url-encoded-string into cl-openid code, because in quicklisp 2013-02-17 drakma changes the function parameters
Fri Feb 22 21:20:12 PST 2013 Anton Vodonosov <avodonosov@yandex.ru>
* copy/paste drakma::alist-to-url-encoded-string into cl-openid code, because in quicklisp 2013-02-17 drakma changes the function parameters
diff -rN -u old-cl-openid/src/message.lisp new-cl-openid/src/message.lisp
--- old-cl-openid/src/message.lisp 2014-07-25 08:58:01.000000000 -0700
+++ new-cl-openid/src/message.lisp 2014-07-25 08:58:01.000000000 -0700
@@ -149,7 +149,7 @@
(uri-query uri)
(when (uri-query uri)
"&")
- (drakma::alist-to-url-encoded-string message :utf-8))) ; FIXME:unexported
+ (alist-to-url-encoded-string message :utf-8)))
uri)
(defun auth-request-realm (auth-request-message)
diff -rN -u old-cl-openid/src/relying-party.lisp new-cl-openid/src/relying-party.lisp
--- old-cl-openid/src/relying-party.lisp 2014-07-25 08:58:01.000000000 -0700
+++ new-cl-openid/src/relying-party.lisp 2014-07-25 08:58:01.000000000 -0700
@@ -133,7 +133,7 @@
(setf (timestamp authproc) (get-universal-time)
(return-to authproc) (copy-uri (root-uri rp)
- :query (drakma::alist-to-url-encoded-string
+ :query (alist-to-url-encoded-string
(acons +authproc-handle-parameter+ handle nil)
:utf-8)))
diff -rN -u old-cl-openid/src/shared.lisp new-cl-openid/src/shared.lisp
--- old-cl-openid/src/shared.lisp 2014-07-25 08:58:01.000000000 -0700
+++ new-cl-openid/src/shared.lisp 2014-07-25 08:58:01.000000000 -0700
@@ -99,3 +99,21 @@
(if (eq #\/ (char path (1- (length path))))
path
(concatenate 'string path "/")))
+
+(defun alist-to-url-encoded-string (alist external-format)
+ ;; Copy/pasted from drakma
+ "ALIST is supposed to be an alist of name/value pairs where both
+names and values are strings \(or, for values, NIL). This function
+returns a string where this list is represented as for the content
+type `application/x-www-form-urlencoded', i.e. the values are
+URL-encoded using the external format EXTERNAL-FORMAT, the pairs are
+joined with a #\\& character, and each name is separated from its
+value with a #\\= character. If the value is NIL, no #\\= is used."
+ (with-output-to-string (out)
+ (loop for first = t then nil
+ for (name . value) in alist
+ unless first do (write-char #\& out)
+ do (format out "~A~:[~;=~A~]"
+ (drakma:url-encode name external-format)
+ value
+ (drakma:url-encode value external-format)))))