]> git.kaiwu.me - haproxy.git/commit
MINOR: http/config: add acceptable-http-re{quest,sponse}-violations
authorWilly Tarreau <w@1wt.eu>
Tue, 20 Oct 2026 13:03:21 +0000 (15:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Oct 2026 15:40:55 +0000 (17:40 +0200)
commit3bca22650dddfe3992e10410f889e8b1ad537dee
tree33af7b721d10b74d16ab7f02e5fb507c7a289ac6
parent113005dd1b0a0b4ae203f5ccfed1630af0d3cfb4
MINOR: http/config: add acceptable-http-re{quest,sponse}-violations

Proxies support HTTP violations relaxation in requests via option
accept-unsafe-violations-in-http-request and in responses via option
accept-unsafe-violations-in-http-response. The problem is that over
time the list of exceptions has grown quite a bit, and that a simple
application that requires to relax one tiny non-dangerous feature
such as enabling raw utf-8 in URLs, we end up enabling many other
things that can be much more dangerous.

This patch introduces a new pair of global settings that permit to
declare which of the HTTP violations are acceptable when a proxy
wants to use them. It's expected that such violations are rare
enough so that a single global setting to adjust them all process-
wide is sufficient.

What the code does is that it introduces a bit field for the request
and the response in the global section, with each bit indicating that
one violation is acceptable, and it permits via the global keyword to
replace the whole list, add an entry or remove an entry. By default,
for backwards compatibility, all exceptions are allowed, but it's
expected that most of the time users will just set one, or will keep
the defaults except some of the most dangerous ones.

For now only the declaration and parsing are handled, and only "none"
and "all" are supported. The keyword parser supports fuzzy matching
and will propose approximating names when one is misspelled.

Subsequent patches will add the options themselves.
include/haproxy/global-t.h
include/haproxy/http-t.h
src/haproxy.c
src/http.c