diff options
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | src/daemon/connection.c | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -17,7 +17,6 @@ connection.c: | |||
17 | - support chunked requests from clients (#1260, ARCH, TEST) | 17 | - support chunked requests from clients (#1260, ARCH, TEST) |
18 | - send proper error code back if client forgot the "Host" header (#1264, TRIV) | 18 | - send proper error code back if client forgot the "Host" header (#1264, TRIV) |
19 | - automatically add MHD_HTTP_HEADER_DATE if client "forgot" to add one (#1261, TRIV) | 19 | - automatically add MHD_HTTP_HEADER_DATE if client "forgot" to add one (#1261, TRIV) |
20 | - automatically drop body from responses to "HEAD" requests (#1262, TRIV) | ||
21 | 20 | ||
22 | For POST: | 21 | For POST: |
23 | ========= | 22 | ========= |
diff --git a/src/daemon/connection.c b/src/daemon/connection.c index ec261963..5139ae0c 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c | |||
@@ -131,6 +131,13 @@ MHD_queue_response(struct MHD_Connection * connection, | |||
131 | MHD_increment_response_rc(response); | 131 | MHD_increment_response_rc(response); |
132 | connection->response = response; | 132 | connection->response = response; |
133 | connection->responseCode = status_code; | 133 | connection->responseCode = status_code; |
134 | if ( (connection->method != NULL) && | ||
135 | (0 == strcasecmp(connection->method, | ||
136 | MHD_HTTP_METHOD_HEAD)) ) { | ||
137 | /* if this is a "HEAD" request, pretend that we | ||
138 | have already sent the full message body */ | ||
139 | connection->messagePos = response->total_size; | ||
140 | } | ||
134 | return MHD_YES; | 141 | return MHD_YES; |
135 | } | 142 | } |
136 | 143 | ||