Skip to content

Commit 4694bcf

Browse files
committed
fix: use updated syntax to disable etags in express
1 parent 9aebc3a commit 4694bcf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/server.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ describe('HTTP Function', () => {
101101
const st = supertest(getTestServer('testHttpFunction'));
102102
await (test.httpVerb === 'GET'
103103
? st.get(test.path)
104-
: st.post(test.path).send({text: 'hello'})
104+
: st.post(test.path).send({ text: 'hello' })
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)