mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Ensure httproute rule match is only of type PathPrefix
This commit is contained in:
@@ -56,10 +56,12 @@ async function getUrlFromHttpRoute(ingress) {
|
||||
|
||||
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}`;
|
||||
if (ingress.spec.rules[0].matches[0].path.type=="PathPrefix"){
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user