mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-05-19 09:28:04 +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?;
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue