mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Backport #12556 SSPI fails badly on authentication attempts to /api/internal which it can never succesfully authenticate. Fix #11260 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		| @@ -100,6 +100,11 @@ func isAPIPath(ctx *macaron.Context) bool { | ||||
| 	return strings.HasPrefix(ctx.Req.URL.Path, "/api/") | ||||
| } | ||||
|  | ||||
| // isInternalPath returns true if the specified URL is an internal API path | ||||
| func isInternalPath(ctx *macaron.Context) bool { | ||||
| 	return strings.HasPrefix(ctx.Req.URL.Path, "/api/internal/") | ||||
| } | ||||
|  | ||||
| // isAttachmentDownload check if request is a file download (GET) with URL to an attachment | ||||
| func isAttachmentDownload(ctx *macaron.Context) bool { | ||||
| 	return strings.HasPrefix(ctx.Req.URL.Path, "/attachments/") && ctx.Req.Method == "GET" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user