summaryrefslogtreecommitdiff
path: root/src/request.rs
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2026-03-05 00:49:17 -0500
committerJohn Turner <jturner.usa@gmail.com>2026-03-05 00:49:17 -0500
commitd7a1ffd41201fdbac858156a8200a8ec5a2dbb76 (patch)
tree5c1eace9a07f8615fc6856e461b3964ded7ec30a /src/request.rs
parenta933ac4a6d99deb6859a4c72761572ef55764afe (diff)
downloadhttpd-d7a1ffd41201fdbac858156a8200a8ec5a2dbb76.tar.gz
return BString instead of Vec, otherwise it creates a table and not a buffer
Diffstat (limited to 'src/request.rs')
-rw-r--r--src/request.rs4
1 files changed, 3 insertions, 1 deletions
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<F: mlua::UserDataFields<Self>>(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()?;