mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 14:03:12 +08:00
Fix: Handle trailing slash for status page routing (#4185)
* Fix: Handle trailing slash * Chore: Add desc for default slug * Chore: Use margin instead of space * Minor
This commit is contained in:
@@ -21,6 +21,12 @@ class StatusPage extends BeanModel {
|
||||
* @returns {void}
|
||||
*/
|
||||
static async handleStatusPageResponse(response, indexHTML, slug) {
|
||||
// Handle url with trailing slash (http://localhost:3001/status/)
|
||||
// The slug comes from the route "/status/:slug". If the slug is empty, express converts it to "index.html"
|
||||
if (slug === "index.html") {
|
||||
slug = "default";
|
||||
}
|
||||
|
||||
let statusPage = await R.findOne("status_page", " slug = ? ", [
|
||||
slug
|
||||
]);
|
||||
|
Reference in New Issue
Block a user