kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Merge branch '851-wrong-og-image-s3' into 'master'
Fix #851: wrong og:image url when using S3 storage See merge request funkwhale/funkwhale!777environments/review-front-revi-ncqkze/deployments/1738
commit
30540709eb
|
@ -113,6 +113,9 @@ def chunk_queryset(source_qs, chunk_size):
|
||||||
|
|
||||||
|
|
||||||
def join_url(start, end):
|
def join_url(start, end):
|
||||||
|
if end.startswith("http://") or end.startswith("https://"):
|
||||||
|
# alread a full URL, joining makes no sense
|
||||||
|
return end
|
||||||
if start.endswith("/") and end.startswith("/"):
|
if start.endswith("/") and end.startswith("/"):
|
||||||
return start + end[1:]
|
return start + end[1:]
|
||||||
|
|
||||||
|
|
|
@ -85,3 +85,17 @@ def test_get_updated_fields(conf, mock_args, data, expected, mocker):
|
||||||
obj = mocker.Mock(**mock_args)
|
obj = mocker.Mock(**mock_args)
|
||||||
|
|
||||||
assert utils.get_updated_fields(conf, data, obj) == expected
|
assert utils.get_updated_fields(conf, data, obj) == expected
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"start, end, expected",
|
||||||
|
[
|
||||||
|
("https://domain", "/api", "https://domain/api"),
|
||||||
|
("https://domain/", "/api", "https://domain/api"),
|
||||||
|
("https://domain", "api", "https://domain/api"),
|
||||||
|
("https://domain", "https://api", "https://api"),
|
||||||
|
("https://domain", "http://api", "http://api"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_join_url(start, end, expected):
|
||||||
|
assert utils.join_url(start, end) == expected
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed wrong og:image url when using S3 storage (#851)
|
Ładowanie…
Reference in New Issue