From c4a6581568b84dc6f139ab04ca0de3e56ed8cc77 Mon Sep 17 00:00:00 2001 From: Evgeny Taktarov Date: Wed, 7 Aug 2024 20:48:57 +0700 Subject: [PATCH] fix: depreceated api response --- pages/api/oneinch-rate.ts | 6 +++++- pages/api/short-lido-stats.ts | 6 +++++- pages/api/sma-steth-apr.ts | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pages/api/oneinch-rate.ts b/pages/api/oneinch-rate.ts index 80132650b..473d8f58b 100644 --- a/pages/api/oneinch-rate.ts +++ b/pages/api/oneinch-rate.ts @@ -1,4 +1,7 @@ -import { wrapRequest as wrapNextRequest } from '@lidofinance/next-api-wrapper'; +import { + cacheControl, + wrapRequest as wrapNextRequest, +} from '@lidofinance/next-api-wrapper'; import { config } from 'config'; import { @@ -24,6 +27,7 @@ export default wrapNextRequest([ cors({ origin: ['*'], methods: [HttpMethod.GET] }), rateLimit, responseTimeMetric(Metrics.request.apiTimings, API_ROUTES.ONEINCH_RATE), + cacheControl({ headers: config.CACHE_DEFAULT_HEADERS }), sunsetBy({ sunsetTimestamp: API_LATER_SUNSET_TIMESTAMP, replacementLink: getReplacementLink(API_ROUTES.ONEINCH_RATE), diff --git a/pages/api/short-lido-stats.ts b/pages/api/short-lido-stats.ts index b8b694e1c..64e30dd2a 100644 --- a/pages/api/short-lido-stats.ts +++ b/pages/api/short-lido-stats.ts @@ -1,4 +1,7 @@ -import { wrapRequest as wrapNextRequest } from '@lidofinance/next-api-wrapper'; +import { + cacheControl, + wrapRequest as wrapNextRequest, +} from '@lidofinance/next-api-wrapper'; import { config } from 'config'; import { @@ -25,6 +28,7 @@ export default wrapNextRequest([ cors({ origin: ['*'], methods: [HttpMethod.GET] }), rateLimit, responseTimeMetric(Metrics.request.apiTimings, API_ROUTES.SHORT_LIDO_STATS), + cacheControl({ headers: config.CACHE_DEFAULT_HEADERS }), sunsetBy({ sunsetTimestamp: API_LATER_SUNSET_TIMESTAMP, replacementLink: getReplacementLink(API_ROUTES.SHORT_LIDO_STATS), diff --git a/pages/api/sma-steth-apr.ts b/pages/api/sma-steth-apr.ts index 4d21ea1cf..5cbdbbada 100644 --- a/pages/api/sma-steth-apr.ts +++ b/pages/api/sma-steth-apr.ts @@ -1,4 +1,7 @@ -import { wrapRequest as wrapNextRequest } from '@lidofinance/next-api-wrapper'; +import { + cacheControl, + wrapRequest as wrapNextRequest, +} from '@lidofinance/next-api-wrapper'; import { config } from 'config'; import { @@ -24,6 +27,7 @@ export default wrapNextRequest([ cors({ origin: ['*'], methods: [HttpMethod.GET] }), rateLimit, responseTimeMetric(Metrics.request.apiTimings, API_ROUTES.SMA_STETH_APR), + cacheControl({ headers: config.CACHE_DEFAULT_HEADERS }), sunsetBy({ sunsetTimestamp: API_DEFAULT_SUNSET_TIMESTAMP, replacementLink: getReplacementLink(API_ROUTES.SMA_STETH_APR),