Browse Source

update CORS headers to allow custom user-agent

Yoginth 7 years ago
parent
commit
a592099e7f
1 changed files with 1 additions and 1 deletions
  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" {