svn: r1311
This commit is contained in:
Jay McCarthy 2005-11-14 14:52:42 +00:00
parent 6f9a489782
commit ae6c167690
2 changed files with 9 additions and 17 deletions

View File

@ -66,12 +66,11 @@
TEXT/HTML-MIME-TYPE TEXT/HTML-MIME-TYPE
`([Location . ,(string-append url-path-str "/")]) `([Location . ,(string-append url-path-str "/")])
(list (list
(xml->string (xexpr->string
(xexpr->xml `(html
`(html (head (title "Add a Slash"))
(head (title "Add a Slash")) (body "Please use "
(body "Please use " (a ([href ,(string-append
(a ([href ,(string-append url-path-str "/")])
url-path-str "/")]) "this url") " instead.")))))
"this url") " instead."))))))
method))) method)))

View File

@ -16,7 +16,6 @@
url-path->string) url-path->string)
(provide/contract (provide/contract
[xml->string (document? . -> . string?)]
[decompose-request ((request?) . ->* . (url? symbol? string?))] [decompose-request ((request?) . ->* . (url? symbol? string?))]
[network-error ((symbol? string?) (listof any/c) . ->* . (void))] [network-error ((symbol? string?) (listof any/c) . ->* . (void))]
[path->list (path? . -> . (cons/c (union path? (symbols 'up 'same)) [path->list (path? . -> . (cons/c (union path? (symbols 'up 'same))
@ -28,12 +27,6 @@
[get-mime-type (path? . -> . bytes?)] [get-mime-type (path? . -> . bytes?)]
[build-path-unless-absolute (path? (union string? path?) . -> . path?)]) [build-path-unless-absolute (path? (union string? path?) . -> . path?)])
;; xml->string: xml -> string
(define (xml->string some-xml)
(let ([o-port (open-output-string)])
(write-xml/content some-xml o-port)
(get-output-string o-port)))
;; ripped this off from url-unit.ss ;; ripped this off from url-unit.ss
(define (url-path->string strs) (define (url-path->string strs)
(apply (apply