Skip to content

Commit eb2871c

Browse files
committed
Ensure that general.partition can still set a client level url
1 parent ea4e5e7 commit eb2871c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/unstructured_client/_hooks/custom/clean_server_url_hook.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def choose_server_url(endpoint_url: str | None, client_url: str, default_endpoin
4444
Default endpoint URL as defined in the spec
4545
"""
4646

47+
# If the client doesn't get a server_url, it sets a default of platform
48+
# This is not always the correct default - we need to make sure default_endpoint_url is used
49+
# So, only use the client url if it has been set to something else
50+
if client_url == "https://platform.unstructuredapp.io":
51+
client_url = ""
52+
4753
url = endpoint_url if endpoint_url is not None else (client_url or default_endpoint_url)
4854
return clean_server_url(url)
4955

0 commit comments

Comments
 (0)