Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add etag

Maidul Islam3b3b76548b6c
diff --git a/backend/package-lock.json b/backend/package-lock.json
index d1d12ad2eb..0b471d2a8e 100644
--- a/backend/package-lock.json
+++ b/backend/package-lock.json
@@ -13,6 +13,7 @@
"@casl/ability": "^6.5.0",
"@fastify/cookie": "^9.2.0",
"@fastify/cors": "^8.4.1",
+ "@fastify/etag": "^5.1.0",
"@fastify/formbody": "^7.4.0",
"@fastify/helmet": "^11.1.1",
"@fastify/passport": "^2.4.0",
@@ -1671,6 +1672,14 @@
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz",
"integrity": "sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ=="
},
+ "node_modules/@fastify/etag": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@fastify/etag/-/etag-5.1.0.tgz",
+ "integrity": "sha512-j/huE8baxgF22idzY35a579b6uP+9ykE9Jt02xY4ZApELNr2KGZmQOKTQsZS94TfKMLfPHwkoM8FfZRq8OZDXg==",
+ "dependencies": {
+ "fastify-plugin": "^4.0.0"
+ }
+ },
"node_modules/@fastify/fast-json-stringify-compiler": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz",
diff --git a/backend/package.json b/backend/package.json
index 39aed4e342..7562612ec8 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -67,6 +67,7 @@
"@casl/ability": "^6.5.0",
"@fastify/cookie": "^9.2.0",
"@fastify/cors": "^8.4.1",
+ "@fastify/etag": "^5.1.0",
"@fastify/formbody": "^7.4.0",
"@fastify/helmet": "^11.1.1",
"@fastify/passport": "^2.4.0",
diff --git a/backend/src/server/app.ts b/backend/src/server/app.ts
index c8eb0d28ff..15f7bcfa8d 100644
--- a/backend/src/server/app.ts
+++ b/backend/src/server/app.ts
@@ -5,6 +5,7 @@ import type { FastifyCookieOptions } from "@fastify/cookie";
import cookie from "@fastify/cookie";
import type { FastifyCorsOptions } from "@fastify/cors";
import cors from "@fastify/cors";
+import fastifyEtag from "@fastify/etag";
import fastifyFormBody from "@fastify/formbody";
import helmet from "@fastify/helmet";
import type { FastifyRateLimitOptions } from "@fastify/rate-limit";
@@ -50,6 +51,8 @@ export const main = async ({ db, smtp, logger, queue }: TMain) => {
secret: appCfg.COOKIE_SECRET_SIGN_KEY
});
+ await server.register(fastifyEtag);
+
await server.register<FastifyCorsOptions>(cors, {
credentials: true,
origin: appCfg.SITE_URL || true