Skip to content

Commit

Permalink
Feature gwa cli v2 fix gwa status results (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikethecoder authored Sep 7, 2023
1 parent db1e05d commit 7d26044
Show file tree
Hide file tree
Showing 2 changed files with 461 additions and 337 deletions.
9 changes: 7 additions & 2 deletions microservices/gatewayApi/v2/routes/gw_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def get_statuses(namespace: str) -> object:
for route in routes:
if route['service']['id'] == service['id'] and 'hosts' in route:
actual_host = route['hosts'][0]
host = clean_host(actual_host)
if route['preserve_host']:
host = clean_host(actual_host)

try:
addr = socket.gethostbyname(service['host'])
Expand All @@ -56,7 +57,11 @@ def get_statuses(namespace: str) -> object:
else:
u = urlparse(url)

headers['Host'] = host
if host is None:
headers['Host'] = u.hostname
else:
headers['Host'] = host

log.info("GET %-30s %s" % ("%s://%s" % (u.scheme, u.netloc), headers))

urllib3.disable_warnings()
Expand Down
Loading

0 comments on commit 7d26044

Please sign in to comment.