Add the PATCH method to the available request methods. (#1692)

This commit is contained in:
bottomtext228 2023-11-07 18:01:16 +03:00 committed by GitHub
parent 52975fbe1e
commit 395b65185b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.