From b95f7b9ffb8bca8a2b9b7a2654602d2207299a1c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 20 Sep 2009 22:24:18 +0200 Subject: Print a http error when the client headers could not be retrieved. A ususal case here is that the headers were buggy, e.g. a line without a ":" to separate the header field name from the value. Previous behaviour was to silently return a blank page. Michael --- src/reqs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/reqs.c b/src/reqs.c index 282d014..2f682b3 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -1597,6 +1597,11 @@ void handle_connection (int fd) if (get_all_headers (connptr->client_fd, hashofheaders) < 0) { log_message (LOG_WARNING, "Could not retrieve all the headers from the client"); + indicate_http_error (connptr, 400, "Bad Request", + "detail", + "Could not retrieve all the headers from " + "the client.", NULL); + send_http_error_message (connptr); hashmap_delete (hashofheaders); update_stats (STAT_BADCONN); destroy_conn (connptr); -- cgit v1.2.3