Don't boilerplate error pages

db4
Slava Pestov 2008-09-29 19:43:45 -05:00
parent 399824edad
commit 2cf2dde83c
1 changed files with 2 additions and 5 deletions

View File

@ -17,16 +17,13 @@ TUPLE: boilerplate < filter-responder template init ;
[ ] >>init ;
: wrap-boilerplate? ( response -- ? )
{
[ code>> { [ 200 = ] [ 400 499 between? ] } 1|| ]
[ content-type>> "text/html" = ]
} 1&& ;
{ [ code>> 200 = ] [ content-type>> "text/html" = ] } 1&& ;
M:: boilerplate call-responder* ( path responder -- )
begin-form
path responder call-next-method
responder init>> call
dup content-type>> "text/html" = [
dup wrap-boilerplate? [
clone [| body |
[
body