mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 05:12:25 -05:00 
			
		
		
		
	close + drain body if response body is too large (#2897)
This commit is contained in:
		
					parent
					
						
							
								6171dcbe51
							
						
					
				
			
			
				commit
				
					
						d3f6960ba0
					
				
			
		
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -400,6 +400,7 @@ func (c *Client) do(r *Request) (rsp *http.Response, retry bool, err error) { | ||||||
| 
 | 
 | ||||||
| 	// Check response body not too large. | 	// Check response body not too large. | ||||||
| 	if rsp.ContentLength > c.bodyMax { | 	if rsp.ContentLength > c.bodyMax { | ||||||
|  | 		_ = rsp.Body.Close() | ||||||
| 		return nil, false, ErrBodyTooLarge | 		return nil, false, ErrBodyTooLarge | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue