fix: normalize HTTP method to uppercase in APIRequest to comply with spec
This commit is contained in:
@@ -144,7 +144,7 @@ class APIRequest {
|
|||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
|
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
method: this.method,
|
method: this.method.toUpperCase(), // Undici doesn't normalize "patch" into "PATCH" (which surprisingly follows the spec).
|
||||||
headers,
|
headers,
|
||||||
agent,
|
agent,
|
||||||
body,
|
body,
|
||||||
|
|||||||
Reference in New Issue
Block a user