From f901507ed70fe8da1fea0544a392c759f2b23be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Falala-Sechet?= Date: Wed, 3 Jul 2019 22:31:16 +0200 Subject: [PATCH] fix: don't add body and content-type headers to sigv4 for delete call in tests --- manual_test_websocket/main/test/e2e/ws.e2e.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manual_test_websocket/main/test/e2e/ws.e2e.js b/manual_test_websocket/main/test/e2e/ws.e2e.js index 246f42873..22bca2728 100644 --- a/manual_test_websocket/main/test/e2e/ws.e2e.js +++ b/manual_test_websocket/main/test/e2e/ws.e2e.js @@ -375,9 +375,9 @@ describe('serverless', () => { await createClient(); const c2 = await createClient(); const url = new URL(endpoint); - const signature = { service: 'execute-api', host: url.host, path: `${url.pathname}/@connections/${c2.id}`, method: 'DELETE', body: 'Hello World!', headers: { 'Content-Type': 'text/plain'/* 'application/text' */ } }; + const signature = { service: 'execute-api', host: url.host, path: `${url.pathname}/@connections/${c2.id}`, method: 'DELETE' }; aws4.sign(signature, { accessKeyId: cred.accessKeyId, secretAccessKey: cred.secretAccessKey }); - const res = await req.del(signature.path.replace(url.pathname, '')).set('X-Amz-Date', signature.headers['X-Amz-Date']).set('Authorization', signature.headers.Authorization).set('Content-Type', signature.headers['Content-Type']); + const res = await req.del(signature.path.replace(url.pathname, '')).set('X-Amz-Date', signature.headers['X-Amz-Date']).set('Authorization', signature.headers.Authorization); expect(res).to.have.status(200); }).timeout(timeout); @@ -387,9 +387,9 @@ describe('serverless', () => { const cId = c.id; c.ws.close(); const url = new URL(endpoint); - const signature = { service: 'execute-api', host: url.host, path: `${url.pathname}/@connections/${cId}`, method: 'DELETE', body: 'Hello World!', headers: { 'Content-Type': 'text/plain'/* 'application/text' */ } }; + const signature = { service: 'execute-api', host: url.host, path: `${url.pathname}/@connections/${cId}`, method: 'DELETE' }; aws4.sign(signature, { accessKeyId: cred.accessKeyId, secretAccessKey: cred.secretAccessKey }); - const res = await req.del(signature.path.replace(url.pathname, '')).set('X-Amz-Date', signature.headers['X-Amz-Date']).set('Authorization', signature.headers.Authorization).set('Content-Type', signature.headers['Content-Type']); + const res = await req.del(signature.path.replace(url.pathname, '')).set('X-Amz-Date', signature.headers['X-Amz-Date']).set('Authorization', signature.headers.Authorization); expect(res).to.have.status(410); }).timeout(timeout);