From: op Date: Fri, 12 Aug 2022 06:41:41 +0000 (+0000) Subject: fix regression introduced in previous commit. HEAD replies don't have a X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=33b680db99566123471595ce06ddde3c15652bab;p=openbsd fix regression introduced in previous commit. HEAD replies don't have a body so server_fcgi_error shouldn't print the end marker. OK claudio@ --- diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c index c0f6ed505c9..4b2c2690f8e 100644 --- a/usr.sbin/httpd/server_fcgi.c +++ b/usr.sbin/httpd/server_fcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_fcgi.c,v 1.91 2022/08/11 14:25:22 op Exp $ */ +/* $OpenBSD: server_fcgi.c,v 1.92 2022/08/12 06:41:41 op Exp $ */ /* * Copyright (c) 2014 Florian Obser @@ -486,6 +486,7 @@ void server_fcgi_error(struct bufferevent *bev, short error, void *arg) { struct client *clt = arg; + struct http_descriptor *desc = clt->clt_descreq; if ((error & EVBUFFER_EOF) && !clt->clt_fcgi.headersdone) { server_abort_http(clt, 500, "malformed or no headers"); @@ -493,7 +494,8 @@ server_fcgi_error(struct bufferevent *bev, short error, void *arg) } /* send the end marker if not already */ - if (clt->clt_fcgi.chunked && !clt->clt_fcgi.end++) + if (desc->http_method != HTTP_METHOD_HEAD && clt->clt_fcgi.chunked && + !clt->clt_fcgi.end++) server_bufferevent_print(clt, "0\r\n\r\n"); server_file_error(bev, error, arg);