mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 23:12:25 -05:00 
			
		
		
		
	[bugfix] Wrap media in read closer (#941)
* use readcloser for content.Content * call media postdata function no matter what * return a readcloser from data func * tidy of logic of readertostore * fix whoopsie
This commit is contained in:
		
					parent
					
						
							
								bd05040133
							
						
					
				
			
			
				commit
				
					
						1dfa7fe0d5
					
				
			
		
					 15 changed files with 88 additions and 92 deletions
				
			
		|  | @ -192,7 +192,7 @@ func (p *processor) UpdateAvatar(ctx context.Context, avatar *multipart.FileHead | |||
| 		return nil, fmt.Errorf("UpdateAvatar: avatar with size %d exceeded max image size of %d bytes", avatar.Size, maxImageSize) | ||||
| 	} | ||||
| 
 | ||||
| 	dataFunc := func(innerCtx context.Context) (io.Reader, int64, error) { | ||||
| 	dataFunc := func(innerCtx context.Context) (io.ReadCloser, int64, error) { | ||||
| 		f, err := avatar.Open() | ||||
| 		return f, avatar.Size, err | ||||
| 	} | ||||
|  | @ -219,7 +219,7 @@ func (p *processor) UpdateHeader(ctx context.Context, header *multipart.FileHead | |||
| 		return nil, fmt.Errorf("UpdateHeader: header with size %d exceeded max image size of %d bytes", header.Size, maxImageSize) | ||||
| 	} | ||||
| 
 | ||||
| 	dataFunc := func(innerCtx context.Context) (io.Reader, int64, error) { | ||||
| 	dataFunc := func(innerCtx context.Context) (io.ReadCloser, int64, error) { | ||||
| 		f, err := header.Open() | ||||
| 		return f, header.Size, err | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue