Skip to content

Commit 89a3abb

Browse files
authored
fix: etag should not be set on any response (#571)
1 parent 9aebc3a commit 89a3abb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function getServer(
108108
app.disable('x-powered-by');
109109

110110
// Disable Express eTag response header
111-
app.disable('etag');
111+
app.set('etag', false);
112112

113113
if (
114114
functionSignatureType === 'event' ||

test/integration/http.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ describe('HTTP Function', () => {
105105
)
106106
.set('Content-Type', 'application/json')
107107
.expect(test.expectedBody)
108-
.expect(test.expectedStatus);
108+
.expect(test.expectedStatus)
109+
.expect(res => assert(!res.get('etag')));
109110
assert.strictEqual(callCount, test.expectedCallCount);
110111
});
111112
});

0 commit comments

Comments
 (0)