Don't fetch HTML pages attached by GNU Social

This commit is contained in:
silverpill 2023-01-14 19:27:47 +00:00
parent 7c07cd79bc
commit 53138ea1c7

View file

@ -173,6 +173,10 @@ pub async fn handle_note(
continue; continue;
}, },
}; };
if attachment.media_type.as_deref() == Some("text/html; charset=UTF-8") {
// Don't fetch HTML pages attached by GNU Social
continue;
};
let attachment_url = attachment.url let attachment_url = attachment.url
.ok_or(ValidationError("attachment URL is missing"))?; .ok_or(ValidationError("attachment URL is missing"))?;
let (file_name, maybe_media_type) = fetch_file( let (file_name, maybe_media_type) = fetch_file(