@@ -4,20 +4,11 @@ import fs from "node:fs";
4
4
import path from "node:path" ;
5
5
import stream from "node:stream" ;
6
6
import { promisify } from "node:util" ;
7
- import { fetch } from "@remix-run/web-fetch" ;
8
7
import gunzip from "gunzip-maybe" ;
9
8
import tar from "tar-fs" ;
10
- import { ProxyAgent } from "proxy-agent" ;
11
9
12
10
import { color , isUrl } from "./utils" ;
13
11
14
- const defaultAgent = new ProxyAgent ( ) ;
15
- const httpsAgent = new ProxyAgent ( ) ;
16
- httpsAgent . protocol = "https:" ;
17
- function agent ( url : string ) {
18
- return new URL ( url ) . protocol === "https:" ? httpsAgent : defaultAgent ;
19
- }
20
-
21
12
export async function copyTemplate (
22
13
template : string ,
23
14
destPath : string ,
@@ -234,10 +225,7 @@ async function downloadAndExtractTarball(
234
225
? `https://api.github.com/repos/${ info . owner } /${ info . name } /releases/latest`
235
226
: `https://api.github.com/repos/${ info . owner } /${ info . name } /releases/tags/${ info . tag } ` ;
236
227
237
- let response = await fetch ( releaseUrl , {
238
- agent : agent ( "https://api.github.com" ) ,
239
- headers,
240
- } ) ;
228
+ let response = await fetch ( releaseUrl , { headers } ) ;
241
229
242
230
if ( response . status !== 200 ) {
243
231
throw new CopyTemplateError (
@@ -274,10 +262,7 @@ async function downloadAndExtractTarball(
274
262
resourceUrl = `https://api.github.com/repos/${ info . owner } /${ info . name } /releases/assets/${ assetId } ` ;
275
263
headers . Accept = "application/octet-stream" ;
276
264
}
277
- let response = await fetch ( resourceUrl , {
278
- agent : agent ( resourceUrl ) ,
279
- headers,
280
- } ) ;
265
+ let response = await fetch ( resourceUrl , { headers } ) ;
281
266
282
267
if ( ! response . body || response . status !== 200 ) {
283
268
if ( token ) {
0 commit comments