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

@ -17,7 +17,7 @@
;; ************************************************************
;; ************************************************************
;; SERVING FILES
;; serve-file : connection symbol uri host -> void
;; to find the file, including searching for implicit index files, and serve it out
(define (serve-file conn method uri host-info)
@ -66,12 +66,11 @@
TEXT/HTML-MIME-TYPE
`([Location . ,(string-append url-path-str "/")])
(list
(xml->string
(xexpr->xml
`(html
(head (title "Add a Slash"))
(body "Please use "
(a ([href ,(string-append
url-path-str "/")])
"this url") " instead."))))))
(xexpr->string
`(html
(head (title "Add a Slash"))
(body "Please use "
(a ([href ,(string-append
url-path-str "/")])
"this url") " instead.")))))
method)))

View File

@ -16,7 +16,6 @@
url-path->string)
(provide/contract
[xml->string (document? . -> . string?)]
[decompose-request ((request?) . ->* . (url? symbol? string?))]
[network-error ((symbol? string?) (listof any/c) . ->* . (void))]
[path->list (path? . -> . (cons/c (union path? (symbols 'up 'same))
@ -27,13 +26,7 @@
[exn->string ((union exn? any/c) . -> . string?)]
[get-mime-type (path? . -> . bytes?)]
[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
(define (url-path->string strs)
(apply