Skip to content

Fix signature + response handling for DELETE requests#24

Merged
abunsen merged 1 commit intomainfrom
fix-delete-signature
Apr 15, 2026
Merged

Fix signature + response handling for DELETE requests#24
abunsen merged 1 commit intomainfrom
fix-delete-signature

Conversation

@abunsen
Copy link
Copy Markdown
Contributor

@abunsen abunsen commented Apr 15, 2026

Two bugs prevented WebhooksService.DeleteAsync from working against the real API:

  1. DELETE fell through to the "body payload" branch in MakeRequestAsync and signed an empty string with no sig_payload query param, so the server returned 401. Extend the GET/POST-no-body signing path to also cover DELETE so the resource id is attached as sig_payload.

  2. MakeRequestAsync always tried to deserialize the response body, which for a 204/empty DELETE response threw JsonException. Return default(T) when the body is empty.

Adds a regression test asserting DELETE requests include sig_payload=.

Two bugs prevented `WebhooksService.DeleteAsync` from working against
the real API:

1. DELETE fell through to the "body payload" branch in `MakeRequestAsync`
   and signed an empty string with no `sig_payload` query param, so the
   server returned 401. Extend the GET/POST-no-body signing path to also
   cover DELETE so the resource id is attached as `sig_payload`.

2. `MakeRequestAsync` always tried to deserialize the response body,
   which for a 204/empty DELETE response threw JsonException. Return
   `default(T)` when the body is empty.

Adds a regression test asserting DELETE requests include `sig_payload=`.
@abunsen abunsen merged commit b2344a3 into main Apr 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant