diff --git a/src/proto_http.c b/src/proto_http.c index c5debcaff..dbd6a2e81 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -601,6 +601,8 @@ int http_remove_header2(struct http_msg *msg, struct buffer *buf, idx->used--; hdr->len = 0; /* unused entry */ idx->v[ctx->prev].next = idx->v[ctx->idx].next; + if (idx->tail == ctx->idx) + idx->tail = ctx->prev; ctx->idx = ctx->prev; /* walk back to the end of previous header */ ctx->line -= idx->v[ctx->idx].len + idx->v[cur_idx].cr + 1; ctx->val = idx->v[ctx->idx].len; /* point to end of previous header */