Skip to content

Commit

Permalink
Fixed bug with dict going off
Browse files Browse the repository at this point in the history
  • Loading branch information
tenfensw committed Oct 17, 2019
1 parent 1181928 commit 3bb65a8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion toolatra_http.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 3bb65a8

Please sign in to comment.