diff --git a/aws-sign4.lisp b/aws-sign4.lisp index 4979b93..a69fb01 100644 --- a/aws-sign4.lisp +++ b/aws-sign4.lisp @@ -67,11 +67,10 @@ parameter ESCAPE% is NIL, the % is not escaped." (defun create-canonical-query-string (params) (format nil "~{~A~^&~}" - (sort (loop for (key . value) in params - collect (format nil "~A=~A" - (url-encode (string key)) - (url-encode (princ-to-string value)))) - #'string<))) + (loop for (key . value) in (sort (copy-seq params) #'string< :key #'car) + collect (format nil "~A=~A" + (url-encode (string key)) + (url-encode (princ-to-string value)))))) (defun trimall (string) (string-trim '(#\Space #\Tab) string))