mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Protect against httproutes for GAMMA where spec.hostnames does not exist.
This commit is contained in:
@@ -53,10 +53,15 @@ const getSchemaFromGateway = async (gatewayRef) => {
|
||||
};
|
||||
|
||||
async function getUrlFromHttpRoute(ingress) {
|
||||
const urlHost = ingress.spec.hostnames[0];
|
||||
const urlPath = ingress.spec.rules[0].matches[0].path.value;
|
||||
const urlSchema = (await getSchemaFromGateway(ingress.spec.parentRefs[0])) ? "https" : "http";
|
||||
return `${urlSchema}://${urlHost}${urlPath}`;
|
||||
|
||||
let url = null
|
||||
if (ingress.spec.has("hostnames")) {
|
||||
const urlHost = ingress.spec.hostnames[0];
|
||||
const urlPath = ingress.spec.rules[0].matches[0].path.value;
|
||||
const urlSchema = (await getSchemaFromGateway(ingress.spec.parentRefs[0])) ? "https" : "http";
|
||||
url = `${urlSchema}://${urlHost}${urlPath}`;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
function getUrlFromIngress(ingress) {
|
||||
|
||||
Reference in New Issue
Block a user