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
master
Michael Adam 2009-09-20 22:24:18 +02:00
parent fcb053a77c
commit b95f7b9ffb
1 changed files with 5 additions and 0 deletions

View File

@ -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);