fix: return absolute path as the icon url if CONSOLE_API_URL is empty (#15279)
This commit is contained in:
parent
59fd3aad31
commit
f2b7df94d7
4 changed files with 23 additions and 21 deletions
|
|
@ -18,6 +18,12 @@ def test_yarl_urls():
|
|||
assert str(URL("https://dify.ai/api") / "v1") == expected_3
|
||||
assert str(URL("https://dify.ai/api/") / "v1") == expected_3
|
||||
|
||||
expected_4 = "api"
|
||||
assert str(URL("") / "api") == expected_4
|
||||
|
||||
expected_5 = "/api"
|
||||
assert str(URL("/") / "api") == expected_5
|
||||
|
||||
with pytest.raises(ValueError) as e1:
|
||||
str(URL("https://dify.ai") / "/api")
|
||||
assert str(e1.value) == "Appending path '/api' starting from slash is forbidden"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue