Skip to content

Commit fea4415

Browse files
committed
Null check for ab-testing:enabled
1 parent a85b084 commit fea4415

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lambda/api/lambda_register.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def lambda_handler(event, context):
9999
# If this endpoint does not match prefix or not enabled return a status code of Not Modified (304)
100100
endpoint_name = event["detail"]["EndpointName"]
101101
endpoint_tags = event["detail"]["Tags"]
102-
endpoint_enabled = endpoint_tags["ab-testing:enabled"] == "true"
102+
endpoint_enabled = endpoint_tags.get("ab-testing:enabled") == "true"
103103
if not (endpoint_name.startswith(ENDPOINT_PREFIX) and endpoint_enabled):
104104
logger.info(
105105
f"Endpoint: {endpoint_name} not enabled for prefix: {ENDPOINT_PREFIX}"

0 commit comments

Comments
 (0)