aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luax/mod.rs2
-rw-r--r--src/server.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/luax/mod.rs b/src/luax/mod.rs
index e5adc9a..70e7b34 100644
--- a/src/luax/mod.rs
+++ b/src/luax/mod.rs
@@ -63,6 +63,8 @@ pub fn table_to_html<W: std::io::Write>(table: rlua::Table, f: &mut W) -> Result
match child? {
rlua::Value::Table(child) => table_to_html(child, f)?,
rlua::Value::String(s) => write!(f, "{}", s.to_str()?)?,
+ rlua::Value::Boolean(b) => write!(f, "{}", b)?,
+ rlua::Value::Number(n) => write!(f, "{}", n)?,
_ => return Err(LuaXError::NonTableChildren.into()),
}
}
diff --git a/src/server.rs b/src/server.rs
index 307aa0c..7aa3cec 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -186,7 +186,7 @@ impl State {
let route: rlua::Function = manifest.get("route")?;
let method = method.as_str();
- let body: Vec<u8> = body.to_bytes().to_vec();
+ let body: rlua::String = ctx.create_string(&body.to_bytes().to_vec())?;
let res: rlua::Result<(rlua::Integer, rlua::Value)> =
route.call((path.clone(), method, body));