Jelajahi Sumber

task-4611 川北剩余高中危漏洞处理
CORS(跨站资源共享)原始验证失败【原理扫描】漏洞修复
修复逻辑错误3

xiexh 9 bulan lalu
induk
melakukan
770e53e73b

+ 2 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/filter/CORSFilter.java

@@ -96,7 +96,8 @@ public class CORSFilter implements Filter {
         String serverDomain = extractBaseDomain(httpRequest.getRequestURL().toString());
 
         // 有Origin头(可能是跨域)
-        String currentDomain = httpRequest.getScheme() + "://" + httpRequest.getServerName();
+        //String currentDomain = httpRequest.getScheme() + "://" + httpRequest.getServerName();
+        String currentDomain =  httpRequest.getServerName();
 
         if (requestDomain.equals(currentDomain)) {
             // 情况2:同源请求(协议+域名相同,端口不同也视为同源)