From d8d635b1abeab6b7ee1ebda25a12a9ebeea47f97 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 8 Sep 2025 13:36:25 -0400 Subject: [PATCH 1/2] fix: allow loading any files from unraid-components --- emhttp/auth-request.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/emhttp/auth-request.php b/emhttp/auth-request.php index 184899bb8..3158dd341 100644 --- a/emhttp/auth-request.php +++ b/emhttp/auth-request.php @@ -54,12 +54,12 @@ $arrWhitelist = [ '/manifest.json' ]; -// Add JS files from the unraid-components directory using cache -$webComponentsDirectory = '/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/'; -$jsFiles = getCachedJSFiles($webComponentsDirectory); -$arrWhitelist = array_merge($arrWhitelist, $jsFiles); +// Whitelist ALL files from the unraid-components directory +$webComponentsDirectory = '/plugins/dynamix.my.servers/unraid-components/'; +$requestUri = preg_replace(['/\?v=\d+$/','/\?\d+$/'],'',$_SERVER['REQUEST_URI']); -if (in_array(preg_replace(['/\?v=\d+$/','/\?\d+$/'],'',$_SERVER['REQUEST_URI']),$arrWhitelist)) { +// Check if the request is for any file in the unraid-components directory +if (str_starts_with($requestUri, $webComponentsDirectory) || in_array($requestUri, $arrWhitelist)) { // authorized http_response_code(200); } else { From 0b8f98ddc7595c7b90cbe29a64562d49cc1088c8 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 8 Sep 2025 13:55:26 -0400 Subject: [PATCH 2/2] fix: update request URI handling in auth-request.php --- emhttp/auth-request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emhttp/auth-request.php b/emhttp/auth-request.php index 3158dd341..b1c5ebea2 100644 --- a/emhttp/auth-request.php +++ b/emhttp/auth-request.php @@ -56,7 +56,7 @@ $arrWhitelist = [ // Whitelist ALL files from the unraid-components directory $webComponentsDirectory = '/plugins/dynamix.my.servers/unraid-components/'; -$requestUri = preg_replace(['/\?v=\d+$/','/\?\d+$/'],'',$_SERVER['REQUEST_URI']); +$requestUri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/'; // Check if the request is for any file in the unraid-components directory if (str_starts_with($requestUri, $webComponentsDirectory) || in_array($requestUri, $arrWhitelist)) {