diff options
author | 2022-09-22 13:47:06 -0500 | |
---|---|---|
committer | 2022-09-22 14:47:06 -0400 | |
commit | 5e4c5252bd80cbaf6a7ee4d4503ece007664410f (patch) | |
tree | e209fdf5e4a0514d90ceb4289d56c5a835126df3 /packages/webapi/src | |
parent | 6ce8ae261f71ae301f70480b207fbb18eb71af75 (diff) | |
download | astro-5e4c5252bd80cbaf6a7ee4d4503ece007664410f.tar.gz astro-5e4c5252bd80cbaf6a7ee4d4503ece007664410f.tar.zst astro-5e4c5252bd80cbaf6a7ee4d4503ece007664410f.zip |
Http proxy for fetch (#4676)
* Add HTTP Proxy Support to `fetch` Polyfill
Use `global-agent` to support HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
environment variables.
* Add Changeset For HTTP Proxy Support in `fetch`
Diffstat (limited to 'packages/webapi/src')
-rw-r--r-- | packages/webapi/src/lib/fetch.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/webapi/src/lib/fetch.ts b/packages/webapi/src/lib/fetch.ts index b099e44af..9c1f7c446 100644 --- a/packages/webapi/src/lib/fetch.ts +++ b/packages/webapi/src/lib/fetch.ts @@ -2,6 +2,13 @@ import type { RequestInit } from 'node-fetch' import { default as nodeFetch, Headers, Request, Response } from 'node-fetch' import Stream from 'node:stream' import * as _ from './utils' +import { + bootstrap as bootstrapGlobalAgent +} from 'global-agent'; + +bootstrapGlobalAgent({ + environmentVariableNamespace: '', +}); export { Headers, Request, Response } |