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