Handle new-style mastodon follow lists
[akkoma] / test / media_proxy_test.exs
index cb455ca79b70a5731e18346cd372570afe1c6395..ddbadfbf542198443b653171d38f6d07d2284869 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.MediaProxyTest do
   use ExUnit.Case
   import Pleroma.Web.MediaProxy
@@ -136,6 +140,15 @@ defmodule Pleroma.MediaProxyTest do
 
       assert String.starts_with?(encoded, Pleroma.Config.get([:media_proxy, :base_url]))
     end
+
+    # https://git.pleroma.social/pleroma/pleroma/issues/580
+    test "encoding S3 links (must preserve `%2F`)" do
+      url =
+        "https://s3.amazonaws.com/example/test.png?X-Amz-Credential=your-access-key-id%2F20130721%2Fus-east-1%2Fs3%2Faws4_request"
+
+      encoded = url(url)
+      assert decode_result(encoded) == url
+    end
   end
 
   describe "when disabled" do