From 89a3abb10a815eeb37bc779ae7015e751765cf62 Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 28 Sep 2023 10:24:12 -0700 Subject: [PATCH] fix: etag should not be set on any response (#571) --- src/server.ts | 2 +- test/integration/http.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server.ts b/src/server.ts index 399becc1..ec3cff91 100644 --- a/src/server.ts +++ b/src/server.ts @@ -108,7 +108,7 @@ export function getServer( app.disable('x-powered-by'); // Disable Express eTag response header - app.disable('etag'); + app.set('etag', false); if ( functionSignatureType === 'event' || diff --git a/test/integration/http.ts b/test/integration/http.ts index f38c1dfb..9f8badcf 100644 --- a/test/integration/http.ts +++ b/test/integration/http.ts @@ -105,7 +105,8 @@ describe('HTTP Function', () => { ) .set('Content-Type', 'application/json') .expect(test.expectedBody) - .expect(test.expectedStatus); + .expect(test.expectedStatus) + .expect(res => assert(!res.get('etag'))); assert.strictEqual(callCount, test.expectedCallCount); }); });