mirror of
https://github.com/hoshikawa2/OCI_API_Gateway_Automation2.git
synced 2026-07-09 17:34:20 +00:00
Correção dos casos:
- Host não pode ser caminho inválido. Melhor optar por IP caso seja um mock-up ao invés de colocar um endpoint inválido pois o API Gateway testa - schema: Se o host não estiver com http:// ou https:// o serviço não estava pegando de schema. Corrigido
This commit is contained in:
Binary file not shown.
@@ -307,9 +307,16 @@ def accMethods_v2(routes, path, status):
|
||||
METHOD = (METHOD + " " + method).lstrip().upper()
|
||||
return METHOD
|
||||
|
||||
def check_endpoint(endpoint):
|
||||
def check_endpoint(schemes, endpoint):
|
||||
if (schemes == ""):
|
||||
if (endpoint.find("http://") == -1 and endpoint.find("https://") == -1):
|
||||
endpoint = "https://" + endpoint
|
||||
else:
|
||||
if (endpoint.find("http://") == -1 and endpoint.find("https://") == -1):
|
||||
if (schemes.find("://") == -1):
|
||||
endpoint = schemes + "://" + endpoint
|
||||
else:
|
||||
endpoint = schemes + endpoint
|
||||
return endpoint
|
||||
|
||||
def key_func(k):
|
||||
@@ -412,7 +419,13 @@ def process_api_spec(api_id, compartmentId, environment, swagger, functionId, ho
|
||||
PATH_PREFIX = find_base_path(spec["path"])
|
||||
METHOD = accMethods(api_spec["routes"], PATH, status)
|
||||
else:
|
||||
fullEndpoint = check_endpoint((endPoint + removeLastSlash(fullSpec["basePath"]) + spec["path"]).replace("{", "${request.path[").replace("}", "]}"))
|
||||
schemes = ""
|
||||
try:
|
||||
schemes = fullSpec["schemes"][0]
|
||||
except:
|
||||
schemes = "https"
|
||||
|
||||
fullEndpoint = check_endpoint(schemes, (endPoint + removeLastSlash(fullSpec["basePath"]) + spec["path"]).replace("{", "${request.path[").replace("}", "]}"))
|
||||
FULL_PATH = fullSpec["basePath"] + spec["path"]
|
||||
ENDPOINT = fullEndpoint
|
||||
PATH = spec["path"]
|
||||
|
||||
Reference in New Issue
Block a user