修改在存在代理的情况下,上传本地文件获取URL不正确问题
This commit is contained in:
parent
b16d50390e
commit
49cf815aa7
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user