diff --git a/serverless/aws/lambda_function.py b/serverless/aws/lambda_function.py index 370719d..cf3ed47 100644 --- a/serverless/aws/lambda_function.py +++ b/serverless/aws/lambda_function.py @@ -79,9 +79,11 @@ def lambda_handler(event, context): headers = { "Content-Type": "application/protobuf", - "Access-Control-Allow-Origin": "*", } + if "CORS" in os.environ: + headers["Access-Control-Allow-Origin"] = os.environ.get("CORS") + if reader.header().metadata.get("compression") == "gzip": if is_api_gateway: # API Gateway requires a compressed response to correctly return binary data