Skip to content

Commit

Permalink
fix issue with redirect failing when dataset is not in the query string
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-negusse committed Jul 12, 2024
1 parent aac0fd6 commit f47bb72
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def handler(event, context):
dataset = path_items[1]
if dataset == "cog":
query_params = parse_qs(query_string)
dataset = query_params.get("dataset", [None])[0]
dataset = query_params.get("dataset", ["cog"])[0]
version = query_params.get("version", [None])[0]
else:
version = path_items[2]

latest_versions = get_latest_versions(f"https://{host}/_latest")

for latest_version in latest_versions:
if latest_version["dataset"] == dataset:
if latest_version["dataset"] == dataset or dataset == "cog":

if "cog" in path_items:
if version != "latest":
Expand Down

0 comments on commit f47bb72

Please sign in to comment.