瀏覽代碼

update CORS headers to allow custom user-agent

Yoginth 7 年之前
父節點
當前提交
a592099e7f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      routes/repo/http.go

+ 1 - 1
routes/repo/http.go

@@ -54,7 +54,7 @@ func HTTPContexter() macaron.Handler {
 		if len(setting.HTTP.AccessControlAllowOrigin) > 0 {
 			// Set CORS headers for browser-based git clients
 			c.Resp.Header().Set("Access-Control-Allow-Origin", setting.HTTP.AccessControlAllowOrigin)
-			c.Resp.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
+			c.Resp.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, User-Agent")
 
 			// Handle preflight OPTIONS request
 			if c.Req.Method == "OPTIONS" {