diff options
Diffstat (limited to '')
-rw-r--r-- | src/shrpx_mruby_module_request.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shrpx_mruby_module_request.cc b/src/shrpx_mruby_module_request.cc index 1ed3aa9..84b39fa 100644 --- a/src/shrpx_mruby_module_request.cc +++ b/src/shrpx_mruby_module_request.cc @@ -71,7 +71,7 @@ mrb_value request_get_method(mrb_state *mrb, mrb_value self) { const auto &req = downstream->request(); auto method = http2::to_method_string(req.method); - return mrb_str_new(mrb, method.c_str(), method.size()); + return mrb_str_new(mrb, method.data(), method.size()); } } // namespace @@ -90,7 +90,7 @@ mrb_value request_set_method(mrb_state *mrb, mrb_value self) { mrb_raise(mrb, E_RUNTIME_ERROR, "method must not be empty string"); } auto token = - http2::lookup_method_token(reinterpret_cast<const uint8_t *>(method), n); + http2::lookup_method_token(StringRef{method, static_cast<size_t>(n)}); if (token == -1) { mrb_raise(mrb, E_RUNTIME_ERROR, "method not supported"); } @@ -107,7 +107,7 @@ mrb_value request_get_authority(mrb_state *mrb, mrb_value self) { auto downstream = data->downstream; const auto &req = downstream->request(); - return mrb_str_new(mrb, req.authority.c_str(), req.authority.size()); + return mrb_str_new(mrb, req.authority.data(), req.authority.size()); } } // namespace @@ -141,7 +141,7 @@ mrb_value request_get_scheme(mrb_state *mrb, mrb_value self) { auto downstream = data->downstream; const auto &req = downstream->request(); - return mrb_str_new(mrb, req.scheme.c_str(), req.scheme.size()); + return mrb_str_new(mrb, req.scheme.data(), req.scheme.size()); } } // namespace @@ -175,7 +175,7 @@ mrb_value request_get_path(mrb_state *mrb, mrb_value self) { auto downstream = data->downstream; const auto &req = downstream->request(); - return mrb_str_new(mrb, req.path.c_str(), req.path.size()); + return mrb_str_new(mrb, req.path.data(), req.path.size()); } } // namespace @@ -235,7 +235,7 @@ mrb_value request_mod_header(mrb_state *mrb, mrb_value self, bool repl) { mrb_gc_arena_restore(mrb, ai); - auto token = http2::lookup_token(keyref.byte(), keyref.size()); + auto token = http2::lookup_token(keyref); if (repl) { size_t p = 0; |