mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 14:31:02 +00:00 
			
		
		
		
	[GITEA] Use maintained gziphandler
- https://github.com/NYTimes/gziphandler doesn't seems to be maintained anymore and Forgejo already includes https://github.com/klauspost/compress which provides a maintained and faster gzip handler fork. - Enables Jitter to prevent BREACH attacks, as this *seems* to be possible in the context of Forgejo. (cherry picked from commitcc2847241d) (cherry picked from commit99ba56a876) Conflicts: go.sum https://codeberg.org/forgejo/forgejo/pulls/1581 (cherry picked from commit711638193d) (cherry picked from commit9c12a37fde) (cherry picked from commit91191aaaed)
This commit is contained in:
		
					parent
					
						
							
								6a4abb928f
							
						
					
				
			
			
				commit
				
					
						72be417f84
					
				
			
		
					 6 changed files with 23 additions and 21 deletions
				
			
		|  | @ -147,6 +147,16 @@ func toHandlerProvider(handler any) func(next http.Handler) http.Handler { | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if hp, ok := handler.(func(next http.Handler) http.HandlerFunc); ok { | ||||
| 		return func(next http.Handler) http.Handler { | ||||
| 			h := hp(next) // this handle could be dynamically generated, so we can't use it for debug info | ||||
| 			return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { | ||||
| 				routing.UpdateFuncInfo(req.Context(), funcInfo) | ||||
| 				h.ServeHTTP(resp, req) | ||||
| 			}) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	provider := func(next http.Handler) http.Handler { | ||||
| 		return http.HandlerFunc(func(respOrig http.ResponseWriter, req *http.Request) { | ||||
| 			// wrap the response writer to check whether the response has been written | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue