Drakma encodes spaces in URLs as pluses instead of "%20"s. It also leaves the characters "$-_.!*'()" unencoded instead of the RFC3986 unencoded set: "-_.~".
This is okay for tolerant servers but for other applications it is a bug. For example, in OAuth it is necessary to conform to RFC3986 or the signature will be incorrect for the request.
To make Drakma more RFC3986-compliant, replace these four lines in util.lisp:
(find char "$-_.!*'()," :test #'char=)) (write-char char out)) ((char= char #\Space) (write-char #+ out))
with these two: (find char "-_.~" :test #'char=)) (write-char char out))
Best regards, Red
On Sun, Oct 4, 2009 at 10:39 PM, Red Daly reddaly@gmail.com wrote:
Drakma encodes spaces in URLs as pluses instead of "%20"s. It also leaves the characters "$-_.!*'()" unencoded instead of the RFC3986 unencoded set: "-_.~".
This is okay for tolerant servers but for other applications it is a bug. For example, in OAuth it is necessary to conform to RFC3986 or the signature will be incorrect for the request.
To make Drakma more RFC3986-compliant, replace these four lines in util.lisp:
(find char "$-_.!*'()," :test #'char=)) (write-char char out)) ((char= char #\Space) (write-char #+ out))
with these two: (find char "-_.~" :test #'char=)) (write-char char out))
Thanks for the info. If you can send a proper patch I'll make a new release immediately.
Edi.