Skip to content

Commit

Permalink
fix(lambda-tiler): content type for jpg should be image/jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Mar 25, 2024
1 parent 499e813 commit ec86dfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/lambda-tiler/src/routes/tile.xyz.raster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const TileXyzRaster = {
const response = new LambdaHttpResponse(200, 'ok');
response.header(HttpHeader.ETag, cacheKey);
response.header(HttpHeader.CacheControl, 'public, max-age=604800, stale-while-revalidate=86400');
response.buffer(res.buffer, 'image/' + xyz.tileType);
response.buffer(res.buffer, `image/${format}`);
return response;
},
};
2 changes: 1 addition & 1 deletion packages/smoke/src/tile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('tile', () => {
it(`should serve a ${ext} tile`, async () => {
const res = await ctx.req(`/v1/tiles/aerial/WebMercatorQuad/6/62/40.${ext}?api=${ctx.apiKey}`);
assert.equal(res.status, 200);
assert.equal(res.headers.get('content-type'), `image/${ext}`);
assert.equal(res.headers.get('content-type'), `image/${ext === 'jpg' ? 'jpeg' : ext}`);
});
}

Expand Down

0 comments on commit ec86dfa

Please sign in to comment.