Skip to content

Commit

Permalink
Fix overriding cache headers (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored Jun 20, 2024
1 parent 557be31 commit 56fb332
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/api/src/app/routes/proxies/coingecko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ const coingeckoProxy: FastifyPluginAsync = async (
}),
// Response headers https://github.com/fastify/fastify-reply-from?tab=readme-ov-file#rewriteheadersheaders-request
rewriteHeaders: (headers, request) => {

// Drop some headers
const newHeaders = DROP_HEADERS.reduce((acc, header) => {
delete acc[header];
return acc;
}, {
...headers,
...(headers.cacheControl
...(headers[CACHE_CONTROL_HEADER]
? {
[CACHE_CONTROL_HEADER]: getCacheControlHeaderValue(CACHE_TTL),
}
Expand Down

0 comments on commit 56fb332

Please # to comment.