1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-12 20:30:57 +00:00

Redirect GET and HEAD requests to sanitized path

This commit is contained in:
Unrud 2022-01-15 22:32:37 +01:00
parent 2b8befa5db
commit a26dcf3188
4 changed files with 29 additions and 17 deletions

View file

@ -28,7 +28,7 @@ const SERVER = location.origin;
* @const
* @type {string}
*/
const ROOT_PATH = location.pathname.replace(new RegExp("/+[^/]+/*(/index\\.html?)?$"), "") + '/';
const ROOT_PATH = (new URL("..", location.href)).pathname;
/**
* Regex to match and normalize color