提交 cfbc7520 编写于 作者: M MaxKey

Update WebContext.java

上级 4b696f87
......@@ -204,20 +204,22 @@ public final class WebContext {
_logger.trace("ServerName " + httpServletRequest.getServerName());
String httpContextPath ="";
if (httpServletRequest.getServerName().matches(ipAddressRegex)
||httpServletRequest.getServerName().equalsIgnoreCase("localhost")) {
String scheme = httpServletRequest.getScheme().toLowerCase();
httpContextPath = scheme + "://"+httpServletRequest.getServerName();
int port = httpServletRequest.getServerPort();
if(!(port==80 || port==443)){
httpContextPath += ":"+port;
}
httpContextPath += httpServletRequest.getContextPath() + "";
httpContextPath = httpServletRequest.getScheme().toLowerCase()
+ "://"+httpServletRequest.getServerName();
httpContextPath += httpServletRequest.getContextPath();
}else {
httpContextPath = applicationConfig.getServerName() + httpServletRequest.getContextPath() + "";
httpContextPath = applicationConfig.getServerName() ;
}
int port = httpServletRequest.getServerPort();
if(!(port==80 || port==443)){
httpContextPath += ":"+port;
}
httpContextPath += httpServletRequest.getContextPath() + "";
_logger.trace("httpContextPath " + httpContextPath);
return httpContextPath;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册