mirror of
https://github.com/LemmyNet/activitypub-federation-rust
synced 2024-11-10 06:04:19 +00:00
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:
|
||||
- &rust_image "rust:1.77-bullseye"
|
||||
- &rust_image "rust:1.78-bullseye"
|
||||
|
||||
steps:
|
||||
cargo_fmt:
|
||||
|
|
|
@ -19,8 +19,8 @@ warnings = "deny"
|
|||
deprecated = "deny"
|
||||
|
||||
[lints.clippy]
|
||||
perf = "deny"
|
||||
complexity = "deny"
|
||||
perf = { level = "deny", priority = -1 }
|
||||
complexity = { level = "deny", priority = -1 }
|
||||
dbg_macro = "deny"
|
||||
inefficient_to_string = "deny"
|
||||
items-after-statements = "deny"
|
||||
|
@ -61,7 +61,7 @@ bytes = "1.6.0"
|
|||
futures-core = { version = "0.3.30", default-features = false }
|
||||
pin-project-lite = "0.2.14"
|
||||
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 = [
|
||||
"sync",
|
||||
"rt",
|
||||
|
|
|
@ -65,9 +65,9 @@ pub async fn fetch_object_http<T: Clone, Kind: DeserializeOwned>(
|
|||
let content_type = res
|
||||
.content_type
|
||||
.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()))?;
|
||||
if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type) {
|
||||
if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type.as_str()) {
|
||||
return Err(Error::FetchInvalidContentType(res.url));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue