Skip to content

Commit

Permalink
fix: etag should not be set on any response (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge authored Sep 28, 2023
1 parent 9aebc3a commit 89a3abb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' ||
Expand Down
3 changes: 2 additions & 1 deletion test/integration/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 89a3abb

Please sign in to comment.