core: Allow dots in MIME file types
As reported in https://github.com/tus/tusd/issues/304
This commit is contained in:
parent
f1fe5e2603
commit
852b6fa01d
|
@ -134,8 +134,8 @@ func TestGet(t *testing.T) {
|
|||
store.EXPECT().GetInfo("yes").Return(FileInfo{
|
||||
Offset: 0,
|
||||
MetaData: map[string]string{
|
||||
"filetype": "text/html",
|
||||
"filename": "invoice.html",
|
||||
"filetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"filename": "invoice.docx",
|
||||
},
|
||||
}, nil)
|
||||
|
||||
|
@ -148,8 +148,8 @@ func TestGet(t *testing.T) {
|
|||
URL: "yes",
|
||||
ResHeader: map[string]string{
|
||||
"Content-Length": "0",
|
||||
"Content-Type": "text/html",
|
||||
"Content-Disposition": `attachment;filename="invoice.html"`,
|
||||
"Content-Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"Content-Disposition": `attachment;filename="invoice.docx"`,
|
||||
},
|
||||
Code: http.StatusNoContent,
|
||||
ResBody: "",
|
||||
|
|
|
@ -24,7 +24,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-z\-\+\.]+$`)
|
||||
)
|
||||
|
||||
// HTTPError represents an error with an additional status code attached
|
||||
|
|
Loading…
Reference in New Issue