Browse Source

test etag

guoziyun 9 months ago
parent
commit
189712b6bd
2 changed files with 5 additions and 0 deletions
  1. 2 0
      oms/dist/src/app.js
  2. 3 0
      oms/src/app.ts

+ 2 - 0
oms/dist/src/app.js

@@ -33,6 +33,8 @@ const redisClient = (0, redis_1.createClient)({ url: redisUri }); // 👈 使用
 exports.redisClient = redisClient;
 redisClient.on("connect", () => console.log("Connected to Redis"));
 redisClient.on("error", (err) => console.error("Redis connection error:", err));
+// --- 关键修改:全局禁用 ETag ---
+app.set("etag", false);
 // Connect to Redis when the application starts
 (async () => {
     try {

+ 3 - 0
oms/src/app.ts

@@ -32,6 +32,9 @@ const redisClient = createClient({ url: redisUri }); // 👈 使用解构后的
 redisClient.on("connect", () => console.log("Connected to Redis"));
 redisClient.on("error", (err: any) => console.error("Redis connection error:", err));
 
+// --- 关键修改:全局禁用 ETag ---
+app.set("etag", false);
+
 // Connect to Redis when the application starts
 (async () => {
   try {