diff --git a/lib/pure/httpserver.nim b/lib/pure/httpserver.nim index 52d5decf28..586f603b3b 100755 --- a/lib/pure/httpserver.nim +++ b/lib/pure/httpserver.nim @@ -35,26 +35,29 @@ proc sendTextContentType(client: TSocket) = send(client, "Content-type: text/html" & wwwNL) send(client, wwwNL) +proc sendStatus(client: TSocket, status: string) = + send(client, "HTTP/1.1 " & status & wwwNL) + proc badRequest(client: TSocket) = # Inform the client that a request it has made has a problem. - send(client, "HTTP/1.0 400 BAD REQUEST" & wwwNL) + send(client, "HTTP/1.1 400 Bad Request" & wwwNL) sendTextContentType(client) send(client, "
Your browser sent a bad request, " & - "such as a POST without a Content-Length." & wwwNL) + "such as a POST without a Content-Length.
" & wwwNL) proc cannotExec(client: TSocket) = - send(client, "HTTP/1.0 500 Internal Server Error" & wwwNL) + send(client, "HTTP/1.1 500 Internal Server Error" & wwwNL) sendTextContentType(client) send(client, "Error prohibited CGI execution." & wwwNL) proc headers(client: TSocket, filename: string) = # XXX could use filename to determine file type - send(client, "HTTP/1.0 200 OK" & wwwNL) + send(client, "HTTP/1.1 200 OK" & wwwNL) send(client, ServerSig) sendTextContentType(client) proc notFound(client: TSocket) = - send(client, "HTTP/1.0 404 NOT FOUND" & wwwNL) + send(client, "HTTP/1.1 404 NOT FOUND" & wwwNL) send(client, ServerSig) sendTextContentType(client) send(client, "