Skip to content

Commit 884460b

Browse files
authoredApr 8, 2022
fix: add missing PATCH method to types (#88)
1 parent 175ec7f commit 884460b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ export type LazyHandler = () => Handler | Promise<Handler>
2727
export type Encoding = false | 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'latin1' | 'binary' | 'hex'
2828

2929
// https://www.rfc-editor.org/rfc/rfc7231#section-4.1
30-
export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE'
30+
export type HTTPMethod = 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE'

‎src/utils/body.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { assertMethod } from './request'
66
const RawBodySymbol = Symbol('h3RawBody')
77
const ParsedBodySymbol = Symbol('h3RawBody')
88

9-
const PayloadMethods = ['PATCH', 'POST', 'PUT', 'DELETE'] as HTTPMethod[]
9+
const PayloadMethods: HTTPMethod[] = ['PATCH', 'POST', 'PUT', 'DELETE']
1010

1111
/**
1212
* Reads body of the request and returns encoded raw string (default) or `Buffer` if encoding if falsy.

0 commit comments

Comments
 (0)
Please sign in to comment.