remove props compression
This commit is contained in:
1 parent
7597068af6
commit
c49c75cb60
4 files changed
+2
-9
No files matched your search
@@ -50,7 +50,6 @@ serde_json = { version = "1.0.95", optional = true }
|
|||||||
tokio-stream = { version = "0.1.12", features = ["sync"], optional = true }
|
tokio-stream = { version = "0.1.12", features = ["sync"], optional = true }
|
||||||
futures-util = { workspace = true, optional = true }
|
futures-util = { workspace = true, optional = true }
|
||||||
postcard = { version = "1.0.4", features = ["use-std"] }
|
postcard = { version = "1.0.4", features = ["use-std"] }
|
||||||
yazi = "0.1.5"
|
|
||||||
base64 = "0.21.0"
|
base64 = "0.21.0"
|
||||||
|
|
||||||
pin-project = "1.1.2"
|
pin-project = "1.1.2"
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[server(PostServerData)]
|
#[server(PostServerData)]
|
||||||
|
#[middleware(Auth(AuthLevel::Admin))]
|
||||||
async fn post_server_data(
|
async fn post_server_data(
|
||||||
#[extract] Axum(axum::extract::Host(host), _): Axum<_, _>,
|
#[extract] Axum(axum::extract::Host(host), _): Axum<_, _>,
|
||||||
data: String,
|
data: String,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use base64::Engine;
|
|||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub(crate) fn serde_from_string<T: DeserializeOwned>(string: &str) -> Option<T> {
|
pub(crate) fn serde_from_string<T: DeserializeOwned>(string: &str) -> Option<T> {
|
||||||
let decompressed = STANDARD.decode(string.as_bytes()).ok()?;
|
let decompressed = STANDARD.decode(string.as_bytes()).ok()?;
|
||||||
let (decompressed, _) = yazi::decompress(&decompressed, yazi::Format::Zlib).unwrap();
|
|
||||||
|
|
||||||
postcard::from_bytes(&decompressed).ok()
|
postcard::from_bytes(&decompressed).ok()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ pub(crate) fn serde_to_writable<T: Serialize>(
|
|||||||
write_to: &mut impl std::io::Write,
|
write_to: &mut impl std::io::Write,
|
||||||
) -> std::io::Result<()> {
|
) -> std::io::Result<()> {
|
||||||
let serialized = postcard::to_allocvec(value).unwrap();
|
let serialized = postcard::to_allocvec(value).unwrap();
|
||||||
let compressed = yazi::compress(
|
write_to.write_all(&STANDARD.encode(serialized).as_bytes())?;
|
||||||
&serialized,
|
|
||||||
yazi::Format::Zlib,
|
|
||||||
yazi::CompressionLevel::BestSize,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
write_to.write_all(&STANDARD.encode(compressed).as_bytes())?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user