mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
BUG/MINOR: cache: Check the return value of http_replace_res_status
Send the full body if the status `304` cannot be applied. This should be the most graceful failure. Specific for 2.3, no backport needed.
This commit is contained in:
parent
787c63c816
commit
e0142340b2
@ -935,8 +935,12 @@ static void http_cache_io_handler(struct appctx *appctx)
|
|||||||
|
|
||||||
/* In case of a conditional request, we might want to send a
|
/* In case of a conditional request, we might want to send a
|
||||||
* "304 Not Modified" response instead of the stored data. */
|
* "304 Not Modified" response instead of the stored data. */
|
||||||
if (appctx->ctx.cache.send_notmodified)
|
if (appctx->ctx.cache.send_notmodified) {
|
||||||
http_replace_res_status(res_htx, ist("304"), ist("Not Modified"));
|
if (!http_replace_res_status(res_htx, ist("304"), ist("Not Modified"))) {
|
||||||
|
/* If replacing the status code fails we need to send the full response. */
|
||||||
|
appctx->ctx.cache.send_notmodified = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Skip response body for HEAD requests or in case of "304 Not
|
/* Skip response body for HEAD requests or in case of "304 Not
|
||||||
* Modified" response. */
|
* Modified" response. */
|
||||||
|
Loading…
Reference in New Issue
Block a user