소스 검색

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" {