RichMedia: Do a HEAD request to check content type/length
authorrinpatch <rinpatch@sdf.org>
Mon, 14 Sep 2020 11:45:58 +0000 (14:45 +0300)
committerrinpatch <rinpatch@sdf.org>
Mon, 14 Sep 2020 11:45:58 +0000 (14:45 +0300)
commitf70335002df9b2b3f47f0ccaed6aaeebfb14435f
tree16c15bdcdf5c5260e58fae9947075aca7d80687a
parentf66a15c4a51e1c8f614b4c1609b2385a29762931
RichMedia: Do a HEAD request to check content type/length

This shouldn't be too expensive, since the connections are pooled,
but it should save us some bandwidth since we won't fetch non-html
files and files that are too large for us to process (especially
since you can't cancel a request without closing the connection
with HTTP1).
lib/pleroma/web/rich_media/helpers.ex
test/support/http_request_mock.ex
test/web/rich_media/parser_test.exs