* stop sending the content for head requests, even when its supplied by the
authorbenno <benno@openbsd.org>
Sat, 23 Oct 2021 15:52:44 +0000 (15:52 +0000)
committerbenno <benno@openbsd.org>
Sat, 23 Oct 2021 15:52:44 +0000 (15:52 +0000)
commit5dfcea78ab7b11789b551a4926e0de60463d0909
treee1df601d2bed2f744ef901a4e8681dd521f4920e
parent24e9ed327c95ee8e131104ebd0e0992a23621187
* stop sending the content for head requests, even when its supplied by the
  fcgi. Required by RFC 7231 and RFC 3875 section 4.3.2.
* If the client sends an empty body without a Content-Lenght:
  do not add the Content-Lenght if it's a HEAD request.
  If it's a HEAD request, the Content-Lenght should show the size of the
  equivalent GET request, but we don't know how much that will be so
  don't lie.

found by and fix suggested by Ross L Richardson, Thanks!

Additionally:

* when the fcgi supplies a Content-Length header, do not remove it and
  set Transfer-Encoding: chunked. Instead, leave the Content-Lenght
  header in place, as obviously the fcgi knows how much data will come.

ok claudio@
usr.sbin/httpd/server_fcgi.c