Skip to content

Commit

Permalink
core: Allow dots in MIME file types
Browse files Browse the repository at this point in the history
As reported in #304
  • Loading branch information
Acconut committed Sep 5, 2019
1 parent f1fe5e2 commit 852b6fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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: "",
Expand Down
2 changes: 1 addition & 1 deletion unrouted_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 852b6fa

Please sign in to comment.