#!/bin/rc # DO NOT make this script callable directly from the web! fn do_error{ echo 'HTTP/1.1 '^$1^$cr emit_extra_headers echo 'Content-type: text/html; charset=utf-8'^$cr echo $cr echo ' '^$1^'

'^$1^'

' echo $2 echo '

rc-httpd at' $SERVER_NAME '' echo ' ' } fn 400{ do_error '400 Bad Request' \ 'The request was invalid.' } fn 401{ do_error '401 Unauthorized' \ 'The requested path '^$"location^' requires authorization.' } fn 404{ do_error '404 Not Found' \ 'The requested path '^$"location^' was not found on this server.' } fn 500{ do_error '500 Internal Server Error' \ 'The server has encountered an internal misconfiguration and is unable to satisfy your request.' } fn 503{ do_error '503 Forbidden' \ 'You do not have permission to access '^$"location^' on this server.' } do_log $1 $1