Skip to content

Commit

Permalink
Merge pull request #729 from frsechet/fix/tests-sigv4-delete-connection
Browse files Browse the repository at this point in the history
fix: don't add body and content-type headers to sigv4
  • Loading branch information
dnalborczyk committed Jul 3, 2019
2 parents c0bea4c + f901507 commit 09d299a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manual_test_websocket/main/test/e2e/ws.e2e.js
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 09d299a

Please sign in to comment.