From 53a2ff6b4addf5ab2bd70ebb57aa5d50d1800ada Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 10 Nov 2023 18:04:22 +0800 Subject: [PATCH] fix status code range; tag 0.1.1 --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- src/lib.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eaf57b4..c7690da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" [[package]] name = "calcit_http" -version = "0.1.0" +version = "0.1.1" dependencies = [ "cirru_edn", "cirru_parser", @@ -32,9 +32,9 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "cirru_edn" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5399b8563cb708471e8ded7433bc65e725fa17e38eb339de468445c1f3ee3c70" +checksum = "8a35d38ee59f7409023f9dee361dc98760f33c9ad1f21283e536939d9561ed44" dependencies = [ "cirru_parser", "hex", diff --git a/Cargo.toml b/Cargo.toml index 3776acf..4b1fb37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "calcit_http" -version = "0.1.0" +version = "0.1.1" authors = ["jiyinyiyong "] edition = "2021" @@ -13,7 +13,7 @@ crate-type = ["dylib"] # Creates dynamic lib # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cirru_edn = "0.4.2" +cirru_edn = "0.5.0" cirru_parser = "0.1.25" tiny_http = "0.12.0" querystring = "1.1.0" diff --git a/src/lib.rs b/src/lib.rs index 29a5550..5fd7296 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ struct HttpServerOptions { } struct ResponseSkeleton { - code: u8, + code: u16, headers: HashMap, Box>, body: Box, } @@ -127,7 +127,7 @@ fn parse_response(info: &Edn) -> Result { body: String::from("").into_boxed_str(), }; res.code = match m.get(&Edn::tag("code")) { - Some(Edn::Number(n)) => *n as u8, + Some(Edn::Number(n)) => *n as u16, None => 200, a => return Err(format!("invalid code: {:?}", a)), };