core: Allow numbers in mime types
See https://community.transloadit.com/t/tus-server-not-returning-the-correct-content-type-for-video-or-audio-file/15076
This commit is contained in:
parent
6f24143015
commit
a045b8c4fc
|
@ -143,7 +143,7 @@ func TestGet(t *testing.T) {
|
|||
upload.EXPECT().GetInfo(context.Background()).Return(FileInfo{
|
||||
Offset: 0,
|
||||
MetaData: map[string]string{
|
||||
"filetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"filetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.v1",
|
||||
"filename": "invoice.docx",
|
||||
},
|
||||
}, nil),
|
||||
|
@ -158,7 +158,7 @@ func TestGet(t *testing.T) {
|
|||
URL: "yes",
|
||||
ResHeader: map[string]string{
|
||||
"Content-Length": "0",
|
||||
"Content-Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"Content-Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.v1",
|
||||
"Content-Disposition": `attachment;filename="invoice.docx"`,
|
||||
},
|
||||
Code: http.StatusNoContent,
|
||||
|
|
|
@ -23,7 +23,7 @@ var (
|
|||
reExtractFileID = regexp.MustCompile(`([^/]+)\/?$`)
|
||||
reForwardedHost = regexp.MustCompile(`host=([^,]+)`)
|
||||
reForwardedProto = regexp.MustCompile(`proto=(https?)`)
|
||||
reMimeType = regexp.MustCompile(`^[a-z]+\/[a-z\-\+\.]+$`)
|
||||
reMimeType = regexp.MustCompile(`^[a-z]+\/[a-z0-9\-\+\.]+$`)
|
||||
)
|
||||
|
||||
// HTTPError represents an error with an additional status code attached
|
||||
|
|
Loading…
Reference in New Issue