Skip to content

Commit

Permalink
Merge pull request #329 from curveball/delete-csrf-before-validation
Browse files Browse the repository at this point in the history
fix patch on /group/:id
  • Loading branch information
evert authored May 31, 2021
2 parents e8a79eb + 9ab6c69 commit 7ded866
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Changelog

* Fix link to schema collection on home document.
* Add Curl to Docker image as it's a common health check tool.
*
* Fix a bug that preventing using `PATCH on /group/:id` in the HAL browser.


0.19.3 (2021-05-30)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions src/group/controller/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class GroupController extends Controller {
*/
async patch(ctx: Context) {

delete (ctx.request.body as any)['csrf-token'];

ctx.request.validate<GroupPatch>('https://curveballjs.org/schemas/a12nserver/group-patch.json');
const group = await principalService.findById(+ctx.params.id, 'group');

Expand Down

0 comments on commit 7ded866

Please sign in to comment.