From 28d8dc5d1deeea747d45826bc38837ae0b532fe5 Mon Sep 17 00:00:00 2001 From: Florent Messa Date: Tue, 16 Jul 2019 10:09:39 +0200 Subject: [PATCH] ref: export mimetypes to constant --- engine/constants.go | 7 +++++++ engine/engine.go | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/engine/constants.go b/engine/constants.go index c0914f53..283a55ce 100644 --- a/engine/constants.go +++ b/engine/constants.go @@ -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", +} diff --git a/engine/engine.go b/engine/engine.go index c3658141..058b4938 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -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 {