Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Namhyeon Go 2025-10-04 19:39:58 +09:00 committed by GitHub
parent cd3e18a4c1
commit 33d8fadc8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -522,13 +522,18 @@ namespace WelsonJS.Launcher
return true;
}
if (allowed.Contains(origin, StringComparer.OrdinalIgnoreCase))
// only perform a single, case-sensitive origin check
if (allowed.Contains(origin, StringComparer.Ordinal))
{
respHeaders["Access-Control-Allow-Origin"] = origin;
respHeaders["Access-Control-Allow-Credentials"] = "true";
return true;
}
{
respHeaders["Access-Control-Allow-Origin"] = origin;
respHeaders["Access-Control-Allow-Credentials"] = "true";
return true;
}
return false;
}