Marius 2019-10-07 11:28:13 +02:00
parent 6f24143015
commit a045b8c4fc
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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