浏览代码

HTTPServer: Fix X-XSS-Protection header formatting (#17620)

Fixes #17619
Yann Verry 6 年之前
父节点
当前提交
ed613194ac
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      pkg/middleware/middleware.go

+ 1 - 2
pkg/middleware/middleware.go

@@ -270,8 +270,7 @@ func AddSecurityHeaders(w macaron.ResponseWriter) {
 	}
 	}
 
 
 	if setting.XSSProtectionHeader {
 	if setting.XSSProtectionHeader {
-		w.Header().Add("X-XSS-Protection", "1")
-		w.Header().Add("X-XSS-Protection", "mode=block")
+		w.Header().Add("X-XSS-Protection", "1; mode=block")
 	}
 	}
 }
 }