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{ upload.EXPECT().GetInfo(context.Background()).Return(FileInfo{
Offset: 0, Offset: 0,
MetaData: map[string]string{ MetaData: map[string]string{
"filetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "filetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.v1",
"filename": "invoice.docx", "filename": "invoice.docx",
}, },
}, nil), }, nil),
@ -158,7 +158,7 @@ func TestGet(t *testing.T) {
URL: "yes", URL: "yes",
ResHeader: map[string]string{ ResHeader: map[string]string{
"Content-Length": "0", "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"`, "Content-Disposition": `attachment;filename="invoice.docx"`,
}, },
Code: http.StatusNoContent, Code: http.StatusNoContent,

View File

@ -23,7 +23,7 @@ var (
reExtractFileID = regexp.MustCompile(`([^/]+)\/?$`) reExtractFileID = regexp.MustCompile(`([^/]+)\/?$`)
reForwardedHost = regexp.MustCompile(`host=([^,]+)`) reForwardedHost = regexp.MustCompile(`host=([^,]+)`)
reForwardedProto = regexp.MustCompile(`proto=(https?)`) 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 // HTTPError represents an error with an additional status code attached