mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-08 16:29:33 +00:00
as ref
This commit is contained in:
parent
fd990f410d
commit
2d98d9466a
|
@ -60,7 +60,9 @@ pub async fn fetch_object_http<T: Clone, Kind: DeserializeOwned>(
|
||||||
let res = fetch_object_http_with_accept(url, data, &CONTENT_TYPE).await?;
|
let res = fetch_object_http_with_accept(url, data, &CONTENT_TYPE).await?;
|
||||||
|
|
||||||
// Ensure correct content-type to prevent vulnerabilities.
|
// Ensure correct content-type to prevent vulnerabilities.
|
||||||
if res.content_type != Some(CONTENT_TYPE) && res.content_type != Some(ALT_CONTENT_TYPE) {
|
if res.content_type.as_ref() != Some(&CONTENT_TYPE)
|
||||||
|
&& res.content_type.as_ref() != Some(&ALT_CONTENT_TYPE)
|
||||||
|
{
|
||||||
return Err(Error::FetchInvalidContentType(res.url));
|
return Err(Error::FetchInvalidContentType(res.url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue