mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 15:59:03 +03:00
chore: update deps (#694)
This commit is contained in:
Generated
+665
-338
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -24,7 +24,7 @@ futures-util = { version = "0.3", default-features = false, features = ["alloc"]
|
||||
async_zip = { version = "0.0.18", default-features = false, features = ["deflate", "bzip2", "xz", "chrono", "tokio"] }
|
||||
headers = "0.4"
|
||||
mime_guess = "2.0"
|
||||
if-addrs = "0.14"
|
||||
if-addrs = "0.15"
|
||||
tokio-rustls = { version = "0.26", optional = true }
|
||||
md5 = "0.8"
|
||||
lazy_static = "1.4"
|
||||
@@ -39,11 +39,11 @@ form_urlencoded = "1.2"
|
||||
alphanumeric-sort = "1.4"
|
||||
content_inspector = "0.2"
|
||||
anyhow = "1.0"
|
||||
chardetng = "0.1"
|
||||
chardetng = "1.0"
|
||||
glob = "0.3"
|
||||
indexmap = "2.2"
|
||||
serde_yaml = "0.9"
|
||||
sha-crypt = "0.5"
|
||||
sha-crypt = "0.6"
|
||||
base64 = "0.22"
|
||||
smart-default = "0.7"
|
||||
rustls-pki-types = "1.2"
|
||||
@@ -51,7 +51,7 @@ hyper-util = { version = "0.1", features = ["server-auto", "tokio"] }
|
||||
http-body-util = "0.1"
|
||||
bytes = "1.5"
|
||||
pin-project-lite = "0.2"
|
||||
sha2 = "0.10.8"
|
||||
sha2 = "0.11.0"
|
||||
ed25519-dalek = "2.2.0"
|
||||
hex = "0.4.3"
|
||||
|
||||
|
||||
+5
-1
@@ -9,6 +9,7 @@ use indexmap::IndexMap;
|
||||
use lazy_static::lazy_static;
|
||||
use md5::Context;
|
||||
use sha2::{Digest, Sha256};
|
||||
use sha_crypt::PasswordVerifier;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
path::{Path, PathBuf},
|
||||
@@ -427,7 +428,10 @@ pub fn check_auth(
|
||||
}
|
||||
|
||||
if auth_pass.starts_with("$6$") {
|
||||
if let Ok(()) = sha_crypt::sha512_check(pass, auth_pass) {
|
||||
if sha_crypt::ShaCrypt::SHA512
|
||||
.verify_password(pass.as_bytes(), auth_pass)
|
||||
.is_ok()
|
||||
{
|
||||
return Some(());
|
||||
}
|
||||
} else if pass == auth_pass {
|
||||
|
||||
+4
-8
@@ -1883,14 +1883,10 @@ async fn get_content_type(path: &Path) -> Result<String> {
|
||||
let mime = mime_guess::from_path(path).first();
|
||||
let is_text = content_inspector::inspect(&buffer).is_text();
|
||||
let content_type = if is_text {
|
||||
let mut detector = chardetng::EncodingDetector::new();
|
||||
let mut detector = chardetng::EncodingDetector::new(chardetng::Iso2022JpDetection::Allow);
|
||||
detector.feed(&buffer, buffer.len() < 1024);
|
||||
let (enc, confident) = detector.guess_assess(None, true);
|
||||
let charset = if confident {
|
||||
format!("; charset={}", enc.name())
|
||||
} else {
|
||||
"".into()
|
||||
};
|
||||
let enc = detector.guess(None, chardetng::Utf8Detection::Allow);
|
||||
let charset = format!("; charset={}", enc.name());
|
||||
match mime {
|
||||
Some(m) => format!("{m}{charset}"),
|
||||
None => format!("text/plain{charset}"),
|
||||
@@ -1934,7 +1930,7 @@ async fn sha256_file(path: &Path) -> Result<String> {
|
||||
}
|
||||
|
||||
let result = hasher.finalize();
|
||||
Ok(format!("{result:x}"))
|
||||
Ok(hex::encode(result))
|
||||
}
|
||||
|
||||
fn has_query_flag(query_params: &HashMap<String, String>, name: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user