Skip to content

Commit

Permalink
Switching parsing to legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-murray authored Oct 11, 2024
1 parent 7566a33 commit 945da31
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/post/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions lib/github-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const jwt = require('jsonwebtoken')
, core = require('@actions/core')
, PrivateKey = require('./private-key')
, HttpsProxyAgent = require('https-proxy-agent').HttpsProxyAgent
, URL = require('node:url')
, url = require('node:url')
;

module.exports.create = (privateKey, applicationId, baseApiUrl, timeout, proxy) => {
Expand Down Expand Up @@ -239,14 +239,15 @@ function proxyExcluded(noProxy, baseUrl) {
core.debug(`noProxyHosts = ${JSON.stringify(noProxyHosts)}`);

core.debug(`parsing baseURL: '${baseUrl}'`);
try {
const parsedBaseUrl = new URL(baseUrl);
core.debug(`parsed = ${parsedBaseUrl}`);
core.debug(`base url host = '${parsedBaseUrl.host}'`);
} catch (err) {
core.error(`Failure in parsing the URL object`);
throw err;
}
// try {
// const parsedBaseUrl = new URL(baseUrl);
// core.debug(`parsed = ${parsedBaseUrl}`);
// core.debug(`base url host = '${parsedBaseUrl.host}'`);
// } catch (err) {
// core.error(`Failure in parsing the URL object`);
// throw err;
// }
const parsedBaseUrl = url.parse(baseUrl);

return noProxyHosts.indexOf(parsedBaseUrl.host) > -1;
}
Expand Down

0 comments on commit 945da31

Please sign in to comment.