mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
Update CloudFormation template. (#435)
* Update CloudFormation template. * Inline Lambda code into CloudFormation template. read x-distribution-name header in TileJSON response if PUBLIC_HOSTNAME is not set. * include both build-zip and build-cloudformation-stack in CI
This commit is contained in:
@@ -160,7 +160,12 @@ export const handlerRaw = async (
|
||||
const header = await p.getHeader();
|
||||
|
||||
if (!tile) {
|
||||
if (!process.env.PUBLIC_HOSTNAME) {
|
||||
if (
|
||||
!(
|
||||
process.env.PUBLIC_HOSTNAME ||
|
||||
event.headers["x-distribution-domain-name"]
|
||||
)
|
||||
) {
|
||||
return apiResp(
|
||||
501,
|
||||
"PUBLIC_HOSTNAME must be set for TileJSON",
|
||||
@@ -173,7 +178,9 @@ export const handlerRaw = async (
|
||||
const t = tileJSON(
|
||||
header,
|
||||
await p.getMetadata(),
|
||||
process.env.PUBLIC_HOSTNAME,
|
||||
process.env.PUBLIC_HOSTNAME ||
|
||||
event.headers["x-distribution-domain-name"] ||
|
||||
"",
|
||||
name
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user