clean up the code

clean up the code
This commit is contained in:
Namhyeon Go 2025-10-09 21:14:41 +09:00
parent 33d8fadc8f
commit b32801c1c9

View File

@ -529,11 +529,6 @@ namespace WelsonJS.Launcher
respHeaders["Access-Control-Allow-Credentials"] = "true"; respHeaders["Access-Control-Allow-Credentials"] = "true";
return true; return true;
} }
{
respHeaders["Access-Control-Allow-Origin"] = origin;
respHeaders["Access-Control-Allow-Credentials"] = "true";
return true;
}
return false; return false;
} }
@ -549,17 +544,15 @@ namespace WelsonJS.Launcher
// Apply CORS headers once here // Apply CORS headers once here
TryApplyCors(context); TryApplyCors(context);
var requestHeaders = context.Request.Headers["Access-Control-Request-Headers"]; var respHeaders = context.Response.Headers;
var requestMethod = context.Request.Headers["Access-Control-Request-Method"]; respHeaders["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE, OPTIONS";
respHeaders["Access-Control-Allow-Headers"] = "Content-Type, Authorization, X-Requested-With";
var h = context.Response.Headers; respHeaders["Access-Control-Max-Age"] = "600";
h["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE, OPTIONS";
h["Access-Control-Allow-Headers"] = "Content-Type, Authorization, X-Requested-With";
h["Access-Control-Max-Age"] = "600";
context.Response.StatusCode = 204; context.Response.StatusCode = 204;
context.Response.ContentLength64 = 0; context.Response.ContentLength64 = 0;
context.Response.OutputStream.Close(); context.Response.OutputStream.Close();
return true; return true;
} }
} }