From d7a1ffd41201fdbac858156a8200a8ec5a2dbb76 Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 5 Mar 2026 00:49:17 -0500 Subject: return BString instead of Vec, otherwise it creates a table and not a buffer --- src/request.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/request.rs b/src/request.rs index 1a0611f..99b7482 100644 --- a/src/request.rs +++ b/src/request.rs @@ -96,7 +96,9 @@ impl UserData for Request { fn add_fields>(fields: &mut F) { fields.add_field_method_get("method", |_, this| Ok(this.method().to_string())); - fields.add_field_method_get("path", |_, this| Ok(this.path().0.clone())); + fields.add_field_method_get("path", |_, this| { + Ok(mlua::BString::new(this.path().inner().clone())) + }); fields.add_field_method_get("headers", |lua, this| { let table = lua.create_table()?; -- cgit v1.2.3