From 04c48f45adfd7a34c66348cf9cd1b6cd117cc467 Mon Sep 17 00:00:00 2001 From: Nicola Reggiani Date: Tue, 23 May 2023 00:57:21 +0200 Subject: [PATCH] Version bump --- dist/index.js | 17 ++++++++++++++++- package.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index de08b91..e3399f2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1657,6 +1657,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -1682,13 +1686,24 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} //# sourceMappingURL=proxy.js.map /***/ }), diff --git a/package.json b/package.json index 4521de7..296f9fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-action-s3-deploy", - "version": "3.2.0", + "version": "4.0.0", "description": "Easily deploy a static website to AWS S3 and invalidate CloudFront distribution", "main": "index.js", "scripts": {