Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5593,7 +5593,7 @@
"@humanwhocodes/gitignore-to-minimatch": "1.0.2",
"@microsoft/tiktokenizer": "^1.0.10",
"@sinclair/typebox": "^0.34.41",
"@vscode/copilot-api": "^0.2.9",
"@vscode/copilot-api": "^0.2.12",
"@vscode/extension-telemetry": "^1.2.0",
"@vscode/l10n": "^0.0.18",
"@vscode/prompt-tsx": "^0.4.0-alpha.6",
Expand Down
2 changes: 1 addition & 1 deletion src/platform/networking/common/fetcherService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface FetchOptions {
* the `Content-Type` header set to `application/json`.
*/
json?: unknown;
method?: 'GET' | 'POST';
method?: 'GET' | 'POST' | 'PUT';
signal?: IAbortSignal;
retryFallbacks?: boolean;
expectJSON?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/platform/networking/node/baseFetchFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export abstract class BaseFetchFetcher implements IFetcher {
}

const method = options.method || 'GET';
if (method !== 'GET' && method !== 'POST') {
throw new Error(`Illegal arguments! 'method' must be either 'GET' or 'POST'!`);
if (method !== 'GET' && method !== 'POST' && method !== 'PUT') {
throw new Error(`Illegal arguments! 'method' must be 'GET', 'POST', or 'PUT'!`);
}

const signal = options.signal ?? new AbortController().signal;
Expand Down Expand Up @@ -81,7 +81,7 @@ export abstract class BaseFetchFetcher implements IFetcher {
return items;
}

private async _fetch(url: string, method: 'GET' | 'POST', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise<Response> {
private async _fetch(url: string, method: 'GET' | 'POST' | 'PUT', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise<Response> {
const resp = await this._fetchImpl(url, { method, headers, body, signal });
return new Response(
resp.status,
Expand Down
6 changes: 3 additions & 3 deletions src/platform/networking/node/nodeFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class NodeFetcher implements IFetcher {
}

const method = options.method || 'GET';
if (method !== 'GET' && method !== 'POST') {
throw new Error(`Illegal arguments! 'method' must be either 'GET' or 'POST'!`);
if (method !== 'GET' && method !== 'POST' && method !== 'PUT') {
throw new Error(`Illegal arguments! 'method' must be 'GET', 'POST', or 'PUT'!`);
}

const signal = options.signal ?? new AbortController().signal;
Expand Down Expand Up @@ -86,7 +86,7 @@ export class NodeFetcher implements IFetcher {
return items;
}

private _fetch(url: string, method: 'GET' | 'POST', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise<Response> {
private _fetch(url: string, method: 'GET' | 'POST' | 'PUT', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise<Response> {
return new Promise((resolve, reject) => {
const module = url.startsWith('https:') ? https : http;
const req = module.request(url, { method, headers }, res => {
Expand Down