Convert content-type to lowercase for comparison (#114)
* Convert content-type to lowercase for comparison * rust 1.78 * clippy priority * upgrade dep
This commit is contained in:
parent
175b22006b
commit
6edbc06a78
3 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
variables:
|
variables:
|
||||||
- &rust_image "rust:1.77-bullseye"
|
- &rust_image "rust:1.78-bullseye"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
cargo_fmt:
|
cargo_fmt:
|
||||||
|
|
|
@ -19,8 +19,8 @@ warnings = "deny"
|
||||||
deprecated = "deny"
|
deprecated = "deny"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
perf = "deny"
|
perf = { level = "deny", priority = -1 }
|
||||||
complexity = "deny"
|
complexity = { level = "deny", priority = -1 }
|
||||||
dbg_macro = "deny"
|
dbg_macro = "deny"
|
||||||
inefficient_to_string = "deny"
|
inefficient_to_string = "deny"
|
||||||
items-after-statements = "deny"
|
items-after-statements = "deny"
|
||||||
|
@ -61,7 +61,7 @@ bytes = "1.6.0"
|
||||||
futures-core = { version = "0.3.30", default-features = false }
|
futures-core = { version = "0.3.30", default-features = false }
|
||||||
pin-project-lite = "0.2.14"
|
pin-project-lite = "0.2.14"
|
||||||
activitystreams-kinds = "0.3.0"
|
activitystreams-kinds = "0.3.0"
|
||||||
regex = { version = "1.10.4", default-features = false, features = ["std", "unicode-case"] }
|
regex = { version = "1.10.5", default-features = false, features = ["std", "unicode"] }
|
||||||
tokio = { version = "1.37.0", features = [
|
tokio = { version = "1.37.0", features = [
|
||||||
"sync",
|
"sync",
|
||||||
"rt",
|
"rt",
|
||||||
|
|
|
@ -65,9 +65,9 @@ pub async fn fetch_object_http<T: Clone, Kind: DeserializeOwned>(
|
||||||
let content_type = res
|
let content_type = res
|
||||||
.content_type
|
.content_type
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|c| c.to_str().ok())
|
.and_then(|c| Some(c.to_str().ok()?.to_lowercase()))
|
||||||
.ok_or(Error::FetchInvalidContentType(res.url.clone()))?;
|
.ok_or(Error::FetchInvalidContentType(res.url.clone()))?;
|
||||||
if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type) {
|
if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type.as_str()) {
|
||||||
return Err(Error::FetchInvalidContentType(res.url));
|
return Err(Error::FetchInvalidContentType(res.url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue