Skip to content

Commit

Permalink
fix: normalize HTTP method to uppercase in APIRequest to comply with …
Browse files Browse the repository at this point in the history
…spec
  • Loading branch information
aiko-chan-ai committed Dec 1, 2024
1 parent d3184f2 commit d087fe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rest/APIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class APIRequest {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
return fetch(url, {
method: this.method,
method: this.method.toUpperCase(), // Undici doesn't normalize "patch" into "PATCH" (which surprisingly follows the spec).
headers,
agent,
body,
Expand Down

0 comments on commit d087fe5

Please sign in to comment.