Update "puppeteer" to 21.0.1
Bug: none
Change-Id: I7b92e1d3c7e14729d99fb8b540d93d9d0be0ecba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4756724
Auto-Submit: Randolf Jung <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
diff --git a/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js b/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js
index d67dc09..cf95ab2 100644
--- a/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js
+++ b/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js
@@ -17,13 +17,12 @@
import * as http from 'http';
import * as https from 'https';
import { URL, urlToHttpOptions } from 'url';
-import { HttpProxyAgent } from 'http-proxy-agent';
-import { HttpsProxyAgent } from 'https-proxy-agent';
-import { getProxyForUrl } from 'proxy-from-env';
-import { SocksProxyAgent } from 'socks-proxy-agent';
+import { ProxyAgent } from 'proxy-agent';
export function headHttpRequest(url) {
return new Promise(resolve => {
const request = httpRequest(url, 'HEAD', response => {
+ // consume response data free node process
+ response.resume();
resolve(response.statusCode === 200);
}, false);
request.on('error', () => {
@@ -32,20 +31,6 @@
});
}
export function httpRequest(url, method, response, keepAlive = true) {
- const proxy = getProxyForUrl(url.toString());
- let agent;
- if (proxy) {
- const proxyUrl = new URL(proxy);
- if (proxyUrl.protocol === 'http:') {
- agent = new HttpProxyAgent(proxyUrl);
- }
- else if (proxyUrl.protocol === 'https:') {
- agent = new HttpsProxyAgent(proxyUrl);
- }
- else if (proxyUrl.protocol.startsWith('socks')) {
- agent = new SocksProxyAgent(proxyUrl);
- }
- }
const options = {
protocol: url.protocol,
hostname: url.hostname,
@@ -54,7 +39,7 @@
method,
headers: keepAlive ? { Connection: 'keep-alive' } : undefined,
auth: urlToHttpOptions(url).auth,
- agent,
+ agent: new ProxyAgent(),
};
const requestCallback = (res) => {
if (res.statusCode &&