mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
lambda function CORS controlled by environment variable
This commit is contained in:
@@ -79,9 +79,11 @@ def lambda_handler(event, context):
|
|||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/protobuf",
|
"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 reader.header().metadata.get("compression") == "gzip":
|
||||||
if is_api_gateway:
|
if is_api_gateway:
|
||||||
# API Gateway requires a compressed response to correctly return binary data
|
# API Gateway requires a compressed response to correctly return binary data
|
||||||
|
|||||||
Reference in New Issue
Block a user