From f0d41a5ac2d3ccbc35b1818be1c860c63325f0d2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 2 Sep 2015 22:41:48 +0900 Subject: [PATCH] nghttpx: Handle nil given to request.set_header as value --- src/shrpx_mruby_module_request.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shrpx_mruby_module_request.cc b/src/shrpx_mruby_module_request.cc index 48d8167a..07257394 100644 --- a/src/shrpx_mruby_module_request.cc +++ b/src/shrpx_mruby_module_request.cc @@ -108,7 +108,7 @@ mrb_value request_set_header(mrb_state *mrb, mrb_value self) { std::string(RSTRING_PTR(key), RSTRING_LEN(key)), std::string(RSTRING_PTR(value), RSTRING_LEN(value))); } - } else { + } else if (!mrb_nil_p(values)) { downstream->add_request_header( std::string(RSTRING_PTR(key), RSTRING_LEN(key)), std::string(RSTRING_PTR(values), RSTRING_LEN(values)));