mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Apply Upload.base_url for S3
This commit is contained in:
parent
ad79983614
commit
3c936061d5
2 changed files with 11 additions and 6 deletions
|
@ -30,7 +30,7 @@ defmodule Pleroma.Uploaders.S3 do
|
||||||
{:ok,
|
{:ok,
|
||||||
{:url,
|
{:url,
|
||||||
Path.join([
|
Path.join([
|
||||||
Keyword.fetch!(config, :public_endpoint),
|
Pleroma.Upload.base_url(),
|
||||||
bucket_with_namespace,
|
bucket_with_namespace,
|
||||||
strict_encode(URI.decode(file))
|
strict_encode(URI.decode(file))
|
||||||
])}}
|
])}}
|
||||||
|
|
|
@ -11,11 +11,16 @@ defmodule Pleroma.Uploaders.S3Test do
|
||||||
import Mock
|
import Mock
|
||||||
import ExUnit.CaptureLog
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
setup do:
|
setup do
|
||||||
|
clear_config(Pleroma.Upload,
|
||||||
|
uploader: Pleroma.Uploaders.S3
|
||||||
|
)
|
||||||
|
|
||||||
clear_config(Pleroma.Uploaders.S3,
|
clear_config(Pleroma.Uploaders.S3,
|
||||||
bucket: "test_bucket",
|
bucket: "test_bucket",
|
||||||
public_endpoint: "https://s3.amazonaws.com"
|
public_endpoint: "https://s3.amazonaws.com"
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
describe "get_file/1" do
|
describe "get_file/1" do
|
||||||
test "it returns path to local folder for files" do
|
test "it returns path to local folder for files" do
|
||||||
|
|
Loading…
Reference in a new issue