Pre Merge pull request !578 from yangxu998/master

This commit is contained in:
yangxu998 2026-06-10 03:34:12 +00:00 committed by Gitee
commit 1a34b91b1c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -26,6 +26,10 @@ public class ServerConfig
public static String getDomain(HttpServletRequest request)
{
String origin = request.getHeader("origin");
if (origin != null && origin.length() > 0) {
return origin;
}
StringBuffer url = request.getRequestURL();
String contextPath = request.getServletContext().getContextPath();
return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();