Skip to content

Commit 51cfd49

Browse files
committed
scgisvc: send response body iff request method was not HEAD
A HEAD request made over a scgi socket should *not* return a body. At least this is what nginx expects given that the moment it receives the empty line terminating the headers, it closes the connection to us. Attempting to send the body has been causing occasional -ESPIPE errors to be logged by blahgd. Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
1 parent 2a50638 commit 51cfd49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scgisvc.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ static void scgi_conn(int fd, struct socksvc_stats *sockstats, void *private)
391391

392392
req->scgi_stats.write_header_time = gettime();
393393

394-
ret = scgi_write_body(req);
394+
/* Write out the body for everything but HEAD requests */
395+
if (req->request.method != SCGI_REQUEST_METHOD_HEAD)
396+
ret = scgi_write_body(req);
395397

396398
req->scgi_stats.write_body_time = gettime();
397399

0 commit comments

Comments
 (0)