修正内部文件服务的协议 #2
16
download/dist/index.js
vendored
16
download/dist/index.js
vendored
@@ -2694,9 +2694,21 @@ function getResultsServiceUrl() {
|
|||||||
if (!resultsUrl) {
|
if (!resultsUrl) {
|
||||||
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable');
|
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable');
|
||||||
}
|
}
|
||||||
return new URL(resultsUrl).origin;
|
const serviceUrl = new URL(resultsUrl);
|
||||||
|
if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) {
|
||||||
|
serviceUrl.protocol = 'http:';
|
||||||
|
}
|
||||||
|
return serviceUrl.origin;
|
||||||
}
|
}
|
||||||
exports.getResultsServiceUrl = getResultsServiceUrl;
|
exports.getResultsServiceUrl = getResultsServiceUrl;
|
||||||
|
function isDockerBridgeIPv4(hostname) {
|
||||||
|
const octets = hostname.split('.').map(Number);
|
||||||
|
return (octets.length === 4 &&
|
||||||
|
octets.every(octet => Number.isInteger(octet) && octet >= 0 && octet <= 255) &&
|
||||||
|
octets[0] === 172 &&
|
||||||
|
octets[1] >= 16 &&
|
||||||
|
octets[1] <= 31);
|
||||||
|
}
|
||||||
function isGhes() {
|
function isGhes() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -124958,4 +124970,4 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|||||||
/******/ module.exports = __webpack_exports__;
|
/******/ module.exports = __webpack_exports__;
|
||||||
/******/
|
/******/
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
|
|||||||
16
upload/dist/index.js
vendored
16
upload/dist/index.js
vendored
@@ -3019,9 +3019,21 @@ function getResultsServiceUrl() {
|
|||||||
if (!resultsUrl) {
|
if (!resultsUrl) {
|
||||||
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable');
|
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable');
|
||||||
}
|
}
|
||||||
return new URL(resultsUrl).origin;
|
const serviceUrl = new URL(resultsUrl);
|
||||||
|
if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) {
|
||||||
|
serviceUrl.protocol = 'http:';
|
||||||
|
}
|
||||||
|
return serviceUrl.origin;
|
||||||
}
|
}
|
||||||
exports.getResultsServiceUrl = getResultsServiceUrl;
|
exports.getResultsServiceUrl = getResultsServiceUrl;
|
||||||
|
function isDockerBridgeIPv4(hostname) {
|
||||||
|
const octets = hostname.split('.').map(Number);
|
||||||
|
return (octets.length === 4 &&
|
||||||
|
octets.every(octet => Number.isInteger(octet) && octet >= 0 && octet <= 255) &&
|
||||||
|
octets[0] === 172 &&
|
||||||
|
octets[1] >= 16 &&
|
||||||
|
octets[1] <= 31);
|
||||||
|
}
|
||||||
function isGhes() {
|
function isGhes() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -129412,4 +129424,4 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|||||||
/******/ module.exports = __webpack_exports__;
|
/******/ module.exports = __webpack_exports__;
|
||||||
/******/
|
/******/
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user