From 6deee2037dd76c7bc612a33d31dc5c8787427844 Mon Sep 17 00:00:00 2001 From: Dylan Plecki Date: Fri, 26 Jan 2018 18:49:08 -0800 Subject: [PATCH] Fix #1119: Stop overwrite of first header on mruby call to env.req.set_header(..) --- src/shrpx_mruby_module_request.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shrpx_mruby_module_request.cc b/src/shrpx_mruby_module_request.cc index dff99ce1..0cd0d038 100644 --- a/src/shrpx_mruby_module_request.cc +++ b/src/shrpx_mruby_module_request.cc @@ -246,8 +246,9 @@ mrb_value request_mod_header(mrb_state *mrb, mrb_value self, bool repl) { continue; } if (i != p) { - headers[p++] = std::move(kv); + headers[p] = std::move(kv); } + ++p; } headers.resize(p); }