Merge pull request #2358 from unraid/fix/permissive-auth-request

fix: allow loading any files from unraid-components
This commit is contained in:
tom mortensen
2025-09-09 09:39:34 -07:00
committed by GitHub

View File

@@ -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 = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/';
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 {