Commit 0a02a397 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add Date and Server headers also on backend error objects

parent 99193208
...@@ -653,11 +653,14 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo) ...@@ -653,11 +653,14 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
{ {
struct storage *st; struct storage *st;
ssize_t l; ssize_t l;
double now;
char time_str[VTIM_FORMAT_SIZE];
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
VSLb_ts_busyobj(bo, "Error", W_TIM_real(wrk)); now = W_TIM_real(wrk);
VSLb_ts_busyobj(bo, "Error", now);
AN(bo->fetch_objcore->flags & OC_F_BUSY); AN(bo->fetch_objcore->flags & OC_F_BUSY);
...@@ -669,6 +672,9 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo) ...@@ -669,6 +672,9 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
HTTP_Setup(bo->beresp, bo->ws, bo->vsl, SLT_BerespMethod); HTTP_Setup(bo->beresp, bo->ws, bo->vsl, SLT_BerespMethod);
http_SetResp(bo->beresp, "HTTP/1.1", 503, "Backend fetch failed"); http_SetResp(bo->beresp, "HTTP/1.1", 503, "Backend fetch failed");
VTIM_format(now, time_str);
http_PrintfHeader(bo->beresp, "Date: %s", time_str);
http_SetHeader(bo->beresp, "Server: Varnish");
bo->exp.t_origin = bo->t_prev; bo->exp.t_origin = bo->t_prev;
bo->exp.ttl = 0; bo->exp.ttl = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment