Skip to content

Commit

Permalink
ref: export mimetypes to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Jul 16, 2019
1 parent bdf2bbb commit 28d8dc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions engine/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ var ContentTypes = map[string]string{
"bmp": "image/bmp",
"gif": "image/gif",
}

var MimeTypes = []string{
"image/jpeg",
"image/png",
"image/bmp",
"image/gif",
}
9 changes: 2 additions & 7 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ func New(cfg config.Config) *Engine {

if cfg.Backends == nil {
b = append(b, Backend{
Backend: &backend.GoImage{},
mimetypes: []string{
"image/jpeg",
"image/png",
"image/bmp",
"image/gif",
},
Backend: &backend.GoImage{},
mimetypes: MimeTypes,
})
} else {
if cfg.Backends.Lilliput != nil {
Expand Down

0 comments on commit 28d8dc5

Please sign in to comment.