瀏覽代碼

fixing mantis 1262

Christian Grothoff 18 年之前
父節點
當前提交
268f93a968
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 0 1
      README
  2. 7 0
      src/daemon/connection.c

+ 0 - 1
README

@@ -17,7 +17,6 @@ connection.c:
 - support chunked requests from clients (#1260, ARCH, TEST)
 - send proper error code back if client forgot the "Host" header (#1264, TRIV)
 - automatically add MHD_HTTP_HEADER_DATE if client "forgot" to add one (#1261, TRIV)
-- automatically drop body from responses to "HEAD" requests (#1262, TRIV)
 
 For POST:
 =========

+ 7 - 0
src/daemon/connection.c

@@ -131,6 +131,13 @@ MHD_queue_response(struct MHD_Connection * connection,
   MHD_increment_response_rc(response);
   connection->response = response;
   connection->responseCode = status_code;
+  if ( (connection->method != NULL) &&
+       (0 == strcasecmp(connection->method,
+			MHD_HTTP_METHOD_HEAD)) ) {
+    /* if this is a "HEAD" request, pretend that we
+       have already sent the full message body */
+    connection->messagePos = response->total_size;  
+  }
   return MHD_YES;
 }