Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Former-commit-id: db3f5014cbc5148cfbe542ec69c2ff330677363b
  • Loading branch information
kataras committed Aug 5, 2019
1 parent cb634a0 commit 3fdaa89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions view/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package view
import (
"io"
"path/filepath"
"strings"

"github.com/kataras/iris/core/errors"
)
Expand All @@ -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
}
}
Expand Down

0 comments on commit 3fdaa89

Please sign in to comment.