Permalink
Browse files

got rid of plain-text feature...it was redundant with blank; added a …

…contract for basic-response; fixed bug with handling edge case with responses; don't export cookie-val anymore
  • Loading branch information...
1 parent fe29443 commit 66a9d662b9bfff1ad5ebe1af41e3814ef85bda2f @vegashacker committed Apr 22, 2009
Showing with 11 additions and 7 deletions.
  1. +0 −4 page.scm
  2. +2 −2 session.scm
  3. +9 −1 web-support.scm
View
@@ -70,7 +70,6 @@
#:body-attrs (body-attrs '())
#:body-wrap (body-wrap (lambda (body) body))
#:blank (blank #f)
- #:plain-text (plain-text #f)
#:design (a-design #f)
#:redirect-to (redirect-to #f)
. body)
@@ -83,9 +82,6 @@
(cond (redirect-to (response-promise-to-redirect redirect-to))
((response/full? returned-body) returned-body)
((response-promise? returned-body) returned-body)
- (plain-text (basic-response (list returned-body)
- ;; Hey, this is probably where we go all unicode...
- #:type #"text/plain; charset=us-ascii"))
(blank returned-body) ; the type of response is default (text/html)
(a-design (a-design returned-body))
(else (let ((main `(html (head ,@(map css-inc css)
View
@@ -19,7 +19,6 @@
make-fresh-session
remove-session
cookied-response
- cookie-val
flash-create!
flash-get!
)
@@ -96,7 +95,8 @@
"/"))))))
(aif (single-response-promise-in-list content-lst)
(response-from-promise it #:headers headers)
- (list-response content-lst #:extras headers))))
+ (or (single-response/full-in-list content-lst)
+ (list-response content-lst #:extras headers)))))
(define (cookie-expiry-time secs-from-now)
(date->string (time-utc->date (make-time 'time-utc 0
View
@@ -20,7 +20,7 @@
web-link
img
raw-str
- basic-response
+ ;; basic-response (via contract)
xexpr-if
url+query
url->string
@@ -61,6 +61,14 @@
#:type type
#:extras extras))
+(provide/contract
+ (basic-response (->*
+ ;; required
+ ((listof bytes?))
+ ;; optional
+ (#:type bytes? #:extras (listof header?))
+ ;; returns
+ response/c)))
(define (basic-response content-lst #:type (type #"text/html") #:extras (extras '()))
;; right now we always no-cache. we'll probably eventually want something more
;; subtle.

0 comments on commit 66a9d66

Please sign in to comment.