Skip to content

Commit

Permalink
fix: allow payloads on DELETE requests
Browse files Browse the repository at this point in the history
  • Loading branch information
runeh committed Jun 7, 2021
1 parent 4af9631 commit 9b2e52b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -915,14 +915,6 @@ describe('call builder', () => {
.body('test')
.build(),
).toThrow();

expect(() =>
buildCall() //
.path('/')
.method('delete')
.body('test')
.build(),
).toThrow();
});

it('throws when trying to add multiple parsers', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class CallBuilder<

invariant(getPath != null, 'No path set');
invariant(method != null, 'No method set');
if (getBody && ['head', 'get', 'delete'].includes(method)) {
if (getBody && ['head', 'get'].includes(method)) {
throw new Error(`Can't include body in "${method}" request`);
}

Expand Down

0 comments on commit 9b2e52b

Please sign in to comment.