Hello,
trying to get www/sogo (caldav/carddav server) to run behind relayd I
found relayd(8) is dropping responses of Code 204 (No Content) IF they
have a Content-Lenght header.
This is on purpose as the code (relay_http.c, 329) has this comment:
* response with a status code of 1xx
* (Informational) or 204 (No Content) MUST
* not have a Content-Length (rfc 7230 3.3.3)
I could not find this MUST within section 3.3.3.
It took some reading until I found that it is actually in
3.3.2. Content-Length
[...]
A server MUST NOT send a Content-Length header field in any response
with a status code of 1xx (Informational) or 204 (No Content). A
server MUST NOT send a Content-Length header field in any 2xx
(Successful) response to a CONNECT request (Section 4.3.6 of
[RFC7231]).
OpenBSD does the right thing, thanks!
Marcus
Index: relay_http.c
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/relay_http.c,v
retrieving revision 1.66
diff -u -p -u -r1.66 relay_http.c
--- relay_http.c 28 May 2017 10:39:15 -0000 1.66
+++ relay_http.c 18 Aug 2017 13:03:42 -0000
@@ -324,7 +324,7 @@ relay_read_http(struct bufferevent *bev,
/*
* response with a status code of 1xx
* (Informational) or 204 (No Content) MUST
- * not have a Content-Length (rfc 7230 3.3.3)
+ * not have a Content-Length (rfc 7230 3.3.2, p.30)
*/
if (desc->http_method == HTTP_METHOD_RESPONSE && (
((desc->http_status >= 100 &&