diff --git a/get_test.go b/get_test.go index ef7f208..e3fcfa8 100644 --- a/get_test.go +++ b/get_test.go @@ -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: "", diff --git a/unrouted_handler.go b/unrouted_handler.go index edd25f9..8392d55 100644 --- a/unrouted_handler.go +++ b/unrouted_handler.go @@ -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