mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Bugfix: Add support for base url with path
This commit is contained in:
parent
bf32550f86
commit
73ee62810d
1 changed files with 7 additions and 2 deletions
|
@ -18,10 +18,15 @@ class RabbitMqMonitorType extends MonitorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
heartbeat.status = DOWN;
|
heartbeat.status = DOWN;
|
||||||
for (const baseUrl of baseUrls) {
|
for (let baseUrl of baseUrls) {
|
||||||
try {
|
try {
|
||||||
|
// Without a trailing slash, path in baseUrl will be removed. https://example.com/api -> https://example.com
|
||||||
|
if ( !baseUrl.endsWith("/") ) {
|
||||||
|
baseUrl += "/";
|
||||||
|
}
|
||||||
const options = {
|
const options = {
|
||||||
url: new URL("/api/health/checks/alarms", baseUrl).href,
|
// Do not start with slash, it will strip the trailing slash from baseUrl
|
||||||
|
url: new URL("api/health/checks/alarms/", baseUrl).href,
|
||||||
method: "get",
|
method: "get",
|
||||||
timeout: monitor.timeout * 1000,
|
timeout: monitor.timeout * 1000,
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Reference in a new issue