Add the PATCH method to the available request methods.

This commit is contained in:
bottomtext228 2023-11-05 19:28:58 +03:00
parent 52975fbe1e
commit 629fa71af7
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ const redirectCodes = new Set([301, 302, 307, 308]);
/**
* @typedef {Object} FetchOptions
* @property {"GET" | "PUT" | "POST" | "DELETE"} [method] - Request method.
* @property {"GET" | "PUT" | "POST" | "DELETE" | "PATCH"} [method] - Request method.
* @property {Record<string, string>} [headers] - Request headers.
* @property {"manual" | "follow"} [redirect] - Whether to follow redirects.
* @property {number} [maxRedirects] - Maximum amount of redirects to be followed.

View File

@ -1,6 +1,6 @@
import Remote from "../../polyfill/remote";
const methods = new Set(["GET", "PUT", "POST", "DELETE"]);
const methods = new Set(["GET", "PUT", "POST", "DELETE", "PATCH"]);
const bodylessStatusCodes = new Set([101, 204, 205, 304]);
class FetchResponse extends Response {
@ -35,7 +35,7 @@ const convertSignal = signal => {
/**
* @typedef {Object} FetchOptions
* @property {"GET" | "PUT" | "POST" | "DELETE"} [method] - Request method.
* @property {"GET" | "PUT" | "POST" | "DELETE" | "PATCH"} [method] - Request method.
* @property {Record<string, string>} [headers] - Request headers.
* @property {"manual" | "follow"} [redirect] - Whether to follow redirects.
* @property {number} [maxRedirects] - Maximum amount of redirects to be followed.