Commits


relayd: strip Content-Length for chunked messages RFC 9112 section 6.1 requires an intermediary that forwards a message carrying Transfer-Encoding to remove any received Content-Length first. relayd already parses the body as chunked in this case, but previously left Content-Length in the header tree, so the backend could receive both framing fields and choose a different message boundary. When chunked framing is selected, remove Content-Length before header emission; this preserves relayd's chunked body handling while avoiding CL.TE ambiguity downstream. Reproted by: Stuart Thomas OK: rsaodwski@


relayd: add support for the MKCALENDAR HTTP method relayd is missing this method from the WebDAV/CalDAV extensions. This causes issues when using relayd as a reverse proxy in front of CalDAV servers like Nextcloud. OK kirill@


Responses to HEAD requests must not have a message body (even though they have a Content-Length header). HTTP RFC 7231 section 4.3.2. found by niklas@, claudio@ agrees.


Fix and tweak websocket upgrade handling. - Don't expect the Connection header to equal Upgrade, it may include Upgrade - Reshuffle the code to check the Upgrade/Connection headers in one place Reported and tested by Rivo Nurges OK and input from benno@ Cvs: ----------------------------------------------------------------------


Support for rfc 6455 Websockets connection upgrade. Add a new protocol option 'http { [no] websockets }' to allow such connections (default is no). Original diff from Daniel Lamando (dan AT danopia DOT net), option and header checks by me. suggestions and ok bluhm@ and earlier diff claudio@


rfc 7230 3.3.3 says: response with a status code of 1xx (Informational) or 204 (No Content) MUST not have a Content-Length. Add a check for that. ok reyk@


Add support for common WebDAV methods; from httpd. Found and tested by Michael Lechtermann OK benno@


Use "compliant" header guards by avoiding the reserved '_' namespace. Pointed out by Markus Elfring OK mikeb@ millert@


Remove fields from struct that are not used. OK benno@


Sync with httpd, including the following change from doug@: "Sync with RFC 7230-7235 phrases and IANA registered status codes. ok reyk@"


Sync file to be identical in relayd(8) and httpd(8).


Move HTTP error codes into http.h. ok benno@


Simplify the code that handles the HTTP headers by using an RB tree with associated lists instead of the complicated lookup table and "others" list. This might add a little malloc overhead for common headers but also fixes some issues like the handling of repeated headers - for example, handling of multiple "Set-Cookie" headers. ok bluhm@ (regress part) ok benno@


Replace the protocol directives for HTTP with a new generic filtering language. The grammar is inspired by pf and allows to write versatile last-matching filter rules in protocol sections starting with the "pass", "block" or "match" keywords. This work was started almost two years ago and replaces large parts of relayd(8)'s HTTP and filtering code. The initial version reimplements and extends HTTP filtering, but will be improved to support generic TCP and other protocols later. With some testing, feedback, and help from benno@ and andre@. OK benno@