mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:32:25 -05:00
* chore: add test of golden cases before fix of #2263 * chore: add test case to reproduce error of #2263 * [bugfix] allow store smaller PNG image than 261 bytes (#2263)
This commit is contained in:
parent
edac3bc361
commit
27f4659139
4 changed files with 72 additions and 2 deletions
|
|
@ -161,8 +161,8 @@ func (p *ProcessingMedia) store(ctx context.Context) error {
|
|||
// and https://github.com/h2non/filetype
|
||||
hdrBuf := make([]byte, 261)
|
||||
|
||||
// Read the first 261 header bytes into buffer.
|
||||
if _, err := io.ReadFull(rc, hdrBuf); err != nil {
|
||||
// Read the first 261 header bytes into buffer as much as possible.
|
||||
if _, err := rc.Read(hdrBuf); err != nil {
|
||||
return gtserror.Newf("error reading incoming media: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue