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

Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
This commit is contained in:
Namhyeon Go 2025-10-03 17:47:01 +09:00 committed by GitHub
parent b9e39dd9c7
commit a745b6d0a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -545,12 +545,8 @@ namespace WelsonJS.Launcher
var requestMethod = context.Request.Headers["Access-Control-Request-Method"]; var requestMethod = context.Request.Headers["Access-Control-Request-Method"];
var h = context.Response.Headers; var h = context.Response.Headers;
h["Access-Control-Allow-Methods"] = string.IsNullOrEmpty(requestMethod) h["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE, OPTIONS";
? "GET, POST, PUT, DELETE, OPTIONS" h["Access-Control-Allow-Headers"] = "Content-Type, Authorization, X-Requested-With";
: requestMethod;
h["Access-Control-Allow-Headers"] = string.IsNullOrEmpty(requestHeaders)
? "Content-Type, Authorization, X-Requested-With"
: requestHeaders;
h["Access-Control-Max-Age"] = "600"; h["Access-Control-Max-Age"] = "600";
context.Response.StatusCode = 204; context.Response.StatusCode = 204;