Content-length should be avoided for HEAD requests.
authorAlex Graveley <alex@ximian.com>
Mon, 30 Jul 2001 22:58:29 +0000 (22:58 +0000)
committerAlex Graveley <orph@src.gnome.org>
Mon, 30 Jul 2001 22:58:29 +0000 (22:58 +0000)
2001-07-30  Alex Graveley  <alex@ximian.com>

* src/soup-core/soup-queue.c (soup_queue_read_headers_cb):
Content-length should be avoided for HEAD requests.

ChangeLog
libsoup/soup-queue.c

index df250db..52f4d32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2001-07-30  Alex Graveley  <alex@ximian.com>
 
+       * src/soup-core/soup-queue.c (soup_queue_read_headers_cb):
+       Content-length should be avoided for HEAD requests.
+
+2001-07-30  Alex Graveley  <alex@ximian.com>
+
        * src/soup-core/soup-misc.c (soup_load_config_internal): Fix bug
        where only the first valid config token is loaded from the config file.
 
index 6bb4d0c..3214a63 100644 (file)
@@ -85,10 +85,13 @@ soup_queue_read_headers_cb (const GString *headers,
        if (connection && g_strcasecmp (connection, "close") == 0)
                soup_connection_set_keep_alive (req->priv->conn, FALSE);
 
+       if (!g_strcasecmp (req->method, "HEAD")) 
+               goto RUN_HANDLERS;
+
        /* Handle Content-Length or Chunked encoding */
        length = g_hash_table_lookup (req->response_headers, "Content-Length");
        enc = g_hash_table_lookup (req->response_headers, "Transfer-Encoding");
-       
+
        if (length) {
                *content_len = atoi (length);
                if (*content_len < 0) 
@@ -102,6 +105,7 @@ soup_queue_read_headers_cb (const GString *headers,
                }
        }
 
+ RUN_HANDLERS:
        err = soup_message_run_handlers (req, SOUP_HANDLER_PRE_BODY);
        if (err) goto THROW_MALFORMED_HEADER;
        if (req->status == SOUP_STATUS_QUEUED) return FALSE;