mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
lambda function CORS controlled by environment variable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user