Minor docs fix and cleanup in http.server.static

db4
Daniel Ehrenberg 2009-02-12 22:26:44 -06:00
parent 1a7e4b6576
commit 1682a5512a
2 changed files with 3 additions and 4 deletions

View File

@ -38,7 +38,7 @@ $nl
"If all you want to do is serve files from a directory, the following phrase does the trick:"
{ $code
"USING: namespaces http.server http.server.static ;"
"/var/www/mysite.com/ <static> main-responder set"
"\"/var/www/mysite.com/\" <static> main-responder set"
"8080 httpd"
}
{ $subsection "http.server.static.extend" } ;

View File

@ -45,9 +45,8 @@ TUPLE: file-responder root hook special allow-listings ;
[ file-responder get hook>> call ] [ 2drop <304> ] if ;
: serving-path ( filename -- filename )
file-responder get root>> trim-tail-separators
"/"
rot "" or trim-head-separators 3append ;
[ file-responder get root>> trim-tail-separators "/" ] dip
"" or trim-head-separators 3append ;
: serve-file ( filename -- response )
dup mime-type