diff --git a/toolatra_http.tcl b/toolatra_http.tcl index f424a3a..e438415 100644 --- a/toolatra_http.tcl +++ b/toolatra_http.tcl @@ -22,8 +22,19 @@ proc _toolatra_http_evalrequest {type url} { return ? } + proc _toolatra_server_finderror {errc} { - set errorCodes [dict create 200 OK 201 Created 202 Accepted 204 No Content 302 "Moved Temporarily" 301 "Moved Permenently" 500 "Internal Server Error" 400 "Bad Request" 404 "Not Found" 403 Forbidden] + set errorCodes [dict create 200 OK \ + 201 Created \ + 202 Accepted \ + 204 {No Content} \ + 302 {Moved Temporarily} \ + 301 {Moved Permenently} \ + 500 {Internal Server Error} \ + 400 {Bad Request} \ + 404 {Not Found} \ + 403 Forbidden] + if {! [dict exists $errorCodes $errc]} { error "HTTP error code not supported by Toolatra: $errc" } @@ -132,6 +143,7 @@ proc _toolatra_tclext_rmempty {listing} { return $result } + proc _toolatra_server_processrequest {sock addr time} { global _toolatra_http_response set _toolatra_http_response [dict create sender $addr when $time]