Skip to content

Commit

Permalink
add clarifying comment for cog asset latest redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-negusse committed Jul 16, 2024
1 parent f47bb72 commit fb0b2b8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def handler(event, context):
dataset = path_items[1]
if dataset == "cog":
query_params = parse_qs(query_string)
# in the case of cog assets, we look for optional
# `dataset` (if url to external cog isn't specified) in query
# parameter setting the default to "cog" instead of `None` for clarity in later steps
dataset = query_params.get("dataset", ["cog"])[0]
version = query_params.get("version", [None])[0]
else:
Expand All @@ -64,6 +67,7 @@ def handler(event, context):
if latest_version["dataset"] == dataset or dataset == "cog":

if "cog" in path_items:

if version != "latest":
return request

Expand Down

0 comments on commit fb0b2b8

Please sign in to comment.