http-response add-headers doesn't work with the stats page #17
Labels
1.6
This issue affects the HAProxy 1.6 stable branch.
1.7
This issue affects the HAProxy 1.7 stable branch.
1.8
This issue affects the HAProxy 1.8 stable branch.
1.9
This issue affects the HAProxy 1.9 stable branch.
2.0
This issue affects the HAProxy 2.0 stable branch.
severity: minor
This issue is of MINOR severity.
status: fixed
This issue is a now-fixed bug.
subsystem: http
This issue is within the HTTP subsystem.
subsystem: stats
This issue is within the stats subsystem.
type: bug
This issue describes a bug.
This issue was reported here : https://www.mail-archive.com/haproxy@formilux.org/msg27447.html
Output of
haproxy -vv
anduname -a
What's the configuration?
Steps to reproduce the behavior
access the stats page
Actual behavior
the headers are missing
Expected behavior
the headers should be present
Do you have any idea what may have caused this?
Lukas diagnosed that the behaviour changed in 1.5-dev with commit 70730dd ("MEDIUM: http: enable analysers to have keep-alive on stats"). The commit message mentions :
It's interesting to note that we do support HTTP compression on the stats response but not HTTP rulesets, just to avoid causing trouble, but here it does have the opposite effect.
Do you have an idea how to solve the issue?
Maybe we'd need to have an options on the stats directive to indicate that there is some post-processing to be done on the response so that we don't remove the response analysers. Or maybe we should always keep them, but we'd then face the usual problem of response rules written for a server possibly blocking a generated response.
A possibly reasonable approach would be to remove the rules for the current proxy : if the stats are in the frontend, frontend rules are not processed. If the stats are in the backend, backend rules are not processed but frontend rules are processed. This would seem fairly natural and it is what the reported tried to do.
The text was updated successfully, but these errors were encountered: