I am currently debugging some problems in my application using the
THttpServer/THttpConnection components regarding the support for HEAD
requests. As far as I understand the specs no response body should be
returned for HEAD but it seems that THttpConnection does send response
bodies in procedure ProcessPost() in case of 400/404/etc. answers. This
probably confuses the client.

Do you think it is meaningful to update the AnswerXXX() procedures like the
following diff example:

-procedure THttpConnection.Answer404;
+procedure THttpConnection.Answer404(SendType : THttpSendType = httpSendDoc);
     Body : String;
@@ -3223,7 +3223,8 @@
             GetKeepAliveHdrLines +
     FAnswerStatus := 404;   { V7.19 }
-    SendStr(Body);
+    if SendType <> httpSendHead then
+        SendStr(Body);
and call Answer404(httpSendHead) within ProcessHead()?


To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to