mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	API calls authorized with HTTP header
This mod allows API calls to be authorized with HTTP header when ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled. Without it user authenticated by reverse proxy is able to access gitea UI but not API which is inconsistent. Author-Change-Id: IB#1107572
This commit is contained in:
		@@ -197,6 +197,10 @@ func reqToken() func(ctx *context.APIContext) {
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if ctx.IsSigned {
 | 
							if ctx.IsSigned {
 | 
				
			||||||
 | 
								// Don't require token if already authenticated by reverse proxy.
 | 
				
			||||||
 | 
								if setting.Service.EnableReverseProxyAuth {
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			ctx.RequireCSRF()
 | 
								ctx.RequireCSRF()
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user