From 3fdaa897ea6c0615d2d8cf406b09fe05b7ce8fdc Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Mon, 5 Aug 2019 20:37:44 +0300 Subject: [PATCH] fix https://github.com/kataras/iris/issues/1327 Former-commit-id: db3f5014cbc5148cfbe542ec69c2ff330677363b --- view/view.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/view.go b/view/view.go index 77894d572..284ebed1e 100644 --- a/view/view.go +++ b/view/view.go @@ -3,6 +3,7 @@ package view import ( "io" "path/filepath" + "strings" "github.com/kataras/iris/core/errors" ) @@ -21,11 +22,10 @@ func (v *View) Register(e Engine) { // Find receives a filename, gets its extension and returns the view engine responsible for that file extension func (v *View) Find(filename string) Engine { - extension := filepath.Ext(filename) // Read-Only no locks needed, at serve/runtime-time the library is not supposed to add new view engines for i, n := 0, len(v.engines); i < n; i++ { e := v.engines[i] - if e.Ext() == extension { + if strings.HasSuffix(filename, e.Ext()) { return e } }