]> git.ipfire.org Git - thirdparty/bind9.git/commit
Improve statschannel HTTP Connection: header protocol conformance
authorTony Finch <fanf@isc.org>
Wed, 7 Jun 2023 14:47:47 +0000 (15:47 +0100)
committerTony Finch <fanf@isc.org>
Thu, 15 Jun 2023 16:03:09 +0000 (17:03 +0100)
commite18ca83a3b1646532ae332081f69122fd4e18ad8
treee2d7379551f2a540bf05940e38744dd0e6652aa9
parenta0efcf0e582eed3e0634c8c67edd9771c53215e7
Improve statschannel HTTP Connection: header protocol conformance

In HTTP/1.0 and HTTP/1.1, RFC 9112 section 9.6 says the last response
in a connection should include a `Connection: close` header, but the
statschannel server omitted it.

In an HTTP/1.0 response, the statschannel server can sometimes send a
`Connection: keep-alive` header when it is about to close the
connection. There are two ways:

If the first request on a connection is keep-alive and the second
request is not, then _both_ responses have `Connection: keep-alive`
but the connection is (correctly) closed after the second response.

If a single request contains

Connection: close
Connection: keep-alive

then RFC 9112 section 9.3 says the keep-alive header is ignored, but
the statschannel sends a spurious keep-alive in its response, though
it correctly closes the connection.

To fix these bugs, make it more clear that the `httpd->flags` are part
of the per-request-response state. The Connection: flags are now
described in terms of the effect they have instead of what causes them
to be set.
CHANGES
bin/tests/system/statschannel/tests.sh
lib/isc/httpd.c