Abstract stuffed-url

svn: r6376
This commit is contained in:
Jay McCarthy 2007-05-29 16:47:14 +00:00
parent 18a781d6cc
commit 6305d748cf
2 changed files with 9 additions and 4 deletions

View File

@ -8,6 +8,7 @@
; XXX different ways to hash, different ways to store (maybe cookie?)
(provide stuff-url
stuffed-url?
extend-url-query
unstuff-url)
@ -36,6 +37,12 @@
(error "the url is too big: " (url->string result-uri)))
result-uri)
(define (stuffed-url? uri)
(let* ([qry (url-query uri)]
[l-code (find-binding 'c qry)])
(and l-code
#t)))
(define (extend-url-query uri key val)
(make-url
(url-scheme uri)

View File

@ -90,10 +90,8 @@
(or
; Look in url for c=<k>
(let* ([ses (current-session)]
[req-url (request-uri req)]
[qry (url-query req-url)]
[l-code (find-binding 'c qry)])
(and l-code
[req-url (request-uri req)])
(and (stuffed-url? req-url)
(deserialize
(unstuff-url
req-url (session-url ses)