Skip to content

Commit 4a72a76

Browse files
tests-restored-locally
1 parent 84ddd53 commit 4a72a76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/python/stackql_test_tooling/registry_rewrite.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ def _replace_token_url(url :str, replacement_host :str) -> str:
134134
return urllib.parse.urlunparse(replaced)
135135

136136
def _replace_server_url(url :str, replacement_host :str, replacement_port: int) -> str:
137+
## handle special case where {scheme}://{host} is used
138+
if url.startswith('{protocol}://{origin:^(?:[^\:/]+(?:\:[0-9]+)?|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?:\:[0-9]+)?)$}/'):
139+
return f'http://{replacement_host}:{replacement_port}/'
137140
parsed = urllib.parse.urlparse(url)
138141
replaced = parsed._replace(netloc="{}:{}".format(replacement_host, replacement_port))
139142
return urllib.parse.urlunparse(replaced)

0 commit comments

Comments
 (0)