diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2020-09-17 14:54:00 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-09-17 14:54:00 +0300 |
commit | 44e8b6037ae71881327451dcf7d9351f1ba82674 (patch) | |
tree | d78e161239f819c3310248f3d1685bc481f0504c /test/support | |
parent | c5830ac037c0c344bd22b674c41f4dc244a088aa (diff) | |
parent | c5acbf8a1bd1a14ea82610cb3f69b8ebbb3ea28b (diff) | |
download | pleroma-44e8b6037ae71881327451dcf7d9351f1ba82674.tar.gz pleroma-44e8b6037ae71881327451dcf7d9351f1ba82674.zip |
Merge branch 'develop' into feature/expire-mutes
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/http_request_mock.ex | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 344e27f13..cb022333f 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -1262,4 +1262,21 @@ defmodule HttpRequestMock do inspect(headers) }"} end + + # Most of the rich media mocks are missing HEAD requests, so we just return 404. + @rich_media_mocks [ + "https://example.com/ogp", + "https://example.com/ogp-missing-data", + "https://example.com/twitter-card" + ] + def head(url, _query, _body, _headers) when url in @rich_media_mocks do + {:ok, %Tesla.Env{status: 404, body: ""}} + end + + def head(url, query, body, headers) do + {:error, + "Mock response not implemented for HEAD #{inspect(url)}, #{query}, #{inspect(body)}, #{ + inspect(headers) + }"} + end end |