aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-02 23:37:44 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-10 23:15:26 +0200
commit07e0063870725506447a0ad29a6b92bb8c8c4e0b (patch)
treec63463f24732171040530bcce4363a236d199a68 /http.c
parentb43adf9a005f93550167c36a33c183ebedd1362d (diff)
http: Support HEAD
Diffstat (limited to 'http.c')
-rw-r--r--http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/http.c b/http.c
index 73c7b67..5bf5251 100644
--- a/http.c
+++ b/http.c
@@ -359,6 +359,8 @@ static int start_line(struct http_ctx *const h)
c->op = HTTP_OP_GET;
else if (!strncmp(line, "POST", n))
c->op = HTTP_OP_POST;
+ else if (!strncmp(line, "HEAD", n))
+ c->op = HTTP_OP_HEAD;
else
{
fprintf(stderr, "%s: unsupported HTTP op %.*s\n",
@@ -1039,6 +1041,8 @@ static int header_cr_line(struct http_ctx *const h)
switch (c->op)
{
case HTTP_OP_GET:
+ /* Fall through. */
+ case HTTP_OP_HEAD:
return process_payload(h, line);
case HTTP_OP_POST: