mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:22:25 -05:00
[bugfix] determine mime-type to use during ffprobe evaluation stage, don't bother checking against file extension (#3506)
* determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension * set mjpeg content-type * fix up tests expecting differing default values
This commit is contained in:
parent
d2820a1470
commit
8f288f1689
16 changed files with 85 additions and 1378 deletions
|
|
@ -18,7 +18,6 @@
|
|||
package media
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
|
@ -28,7 +27,6 @@ import (
|
|||
|
||||
"codeberg.org/gruf/go-bytesize"
|
||||
"codeberg.org/gruf/go-iotools"
|
||||
"codeberg.org/gruf/go-mimetypes"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
)
|
||||
|
||||
|
|
@ -87,12 +85,6 @@ func getExtension(path string) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// getMimeType returns a suitable mimetype for file extension.
|
||||
func getMimeType(ext string) string {
|
||||
const defaultType = "application/octet-stream"
|
||||
return cmp.Or(mimetypes.MimeTypes[ext], defaultType)
|
||||
}
|
||||
|
||||
// drainToTmp drains data from given reader into a new temp file
|
||||
// and closes it, returning the path of the resulting temp file.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue