Apply Upload.base_url for S3
This commit is contained in:
parent
ad79983614
commit
3c936061d5
|
@ -30,7 +30,7 @@ def get_file(file) do
|
|||
{:ok,
|
||||
{:url,
|
||||
Path.join([
|
||||
Keyword.fetch!(config, :public_endpoint),
|
||||
Pleroma.Upload.base_url(),
|
||||
bucket_with_namespace,
|
||||
strict_encode(URI.decode(file))
|
||||
])}}
|
||||
|
|
|
@ -11,11 +11,16 @@ defmodule Pleroma.Uploaders.S3Test do
|
|||
import Mock
|
||||
import ExUnit.CaptureLog
|
||||
|
||||
setup do:
|
||||
clear_config(Pleroma.Uploaders.S3,
|
||||
bucket: "test_bucket",
|
||||
public_endpoint: "https://s3.amazonaws.com"
|
||||
)
|
||||
setup do
|
||||
clear_config(Pleroma.Upload,
|
||||
uploader: Pleroma.Uploaders.S3
|
||||
)
|
||||
|
||||
clear_config(Pleroma.Uploaders.S3,
|
||||
bucket: "test_bucket",
|
||||
public_endpoint: "https://s3.amazonaws.com"
|
||||
)
|
||||
end
|
||||
|
||||
describe "get_file/1" do
|
||||
test "it returns path to local folder for files" do
|
||||
|
|
Loading…
Reference in a new issue