Skip to content

Commit

Permalink
correctly url-encoding-decode things again
Browse files Browse the repository at this point in the history
  • Loading branch information
vii committed Jan 11, 2010
1 parent 88a0a63 commit e3cbb15
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/http/dispatcher.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@

(defun-speedy map-http-params (func)
(declare (dynamic-extent func) (type (function (simple-byte-vector simple-byte-vector) t) func))
(flet ((parse-params (str)
(labels (
(f (name value)
(funcall func (url-encoding-decode name) (url-encoding-decode value)))
(parse-params (str)
(when str
(match-bind ( (* name "=" value (or (last) "&")
'(funcall func name value)))
'(f name value)))
str)))
(parse-cookie-params (str)
(when str
(match-bind ( (* name "=" value (or (last) "," ";")
'(funcall func name value)))
'(f name value)))
str))))
(declare (inline parse-cookie-params parse-params)
(dynamic-extent #'parse-params #'parse-cookie-params))
(declare (inline parse-cookie-params parse-params f)
(dynamic-extent #'parse-params #'parse-cookie-params #'f))
(parse-params (servestate-query-string*))
(parse-params (servestate-post-parameters*))
(parse-cookie-params (servestate-cookie*))))
Expand Down

0 comments on commit e3cbb15

Please sign in to comment.