Skip to content

Commit

Permalink
Fix: support all known http methods (#9689)
Browse files Browse the repository at this point in the history
* fix: support all known http methods

* fix: support all known http methods
  • Loading branch information
runspired authored Feb 22, 2025
1 parent 0067e72 commit 78cd79b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/core-types/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ export const EnableHydration = getOrSetUniversal('EnableHydration', Symbol.for('
export const IS_FUTURE = getOrSetGlobal('IS_FUTURE', Symbol('IS_FUTURE'));
export const STRUCTURED = getOrSetGlobal('DOC', Symbol('DOC'));

export type HTTPMethod = 'GET' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
export type HTTPMethod =
| 'QUERY'
| 'GET'
| 'OPTIONS'
| 'POST'
| 'PUT'
| 'PATCH'
| 'DELETE'
| 'HEAD'
| 'CONNECT'
| 'TRACE';

/**
* Use these options to adjust CacheHandler behavior for a request.
Expand Down
2 changes: 1 addition & 1 deletion packages/request/src/-private/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ValidKeys = new Map<string, string | string[] | typeof BODY_TYPES>([
['headers', 'headers'],
['integrity', 'string'],
['keepalive', 'boolean'],
['method', ['GET', 'PUT', 'PATCH', 'DELETE', 'POST', 'OPTIONS']],
['method', ['QUERY', 'GET', 'PUT', 'PATCH', 'DELETE', 'POST', 'OPTIONS', 'HEAD', 'CONNECT', 'TRACE']],
['mode', ['same-origin', 'cors', 'navigate', 'no-cors']],
['redirect', ['error', 'follow', 'manual']],
['referrer', 'string'],
Expand Down

0 comments on commit 78cd79b

Please sign in to comment.