Skip to content

Commit d087fe5

Browse files
committed
fix: normalize HTTP method to uppercase in APIRequest to comply with spec
1 parent d3184f2 commit d087fe5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rest/APIRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class APIRequest {
144144
const controller = new AbortController();
145145
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
146146
return fetch(url, {
147-
method: this.method,
147+
method: this.method.toUpperCase(), // Undici doesn't normalize "patch" into "PATCH" (which surprisingly follows the spec).
148148
headers,
149149
agent,
150150
body,

0 commit comments

Comments
 (0)