1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 13:05:56 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-09 05:41:20 +02:00
parent 72c2dafd2e
commit 8aedf6bc32
36 changed files with 99 additions and 130 deletions

View File

@@ -442,9 +442,9 @@ func StripPrefix(prefix string, h context.Handler) context.Handler {
func toWebPath(systemPath string) string {
// winos slash to slash
webpath := strings.Replace(systemPath, "\\", "/", -1)
webpath := strings.ReplaceAll(systemPath, "\\", "/")
// double slashes to single
webpath = strings.Replace(webpath, "//", "/", -1)
webpath = strings.ReplaceAll(webpath, "//", "/")
return webpath
}
@@ -1013,7 +1013,7 @@ func cacheFiles(ctx stdContext.Context, fs http.FileSystem, names []string, comp
case <-ctx.Done():
return ctx.Err()
default:
break
break // lint:ignore
}
if alg == "brotli" {
@@ -1218,7 +1218,7 @@ var _ http.File = (*dir)(nil)
// returns unorderded map of directories both reclusive and flat.
func findDirs(fs http.FileSystem, names []string) (map[string]*dir, error) {
dirs := make(map[string]*dir, 0)
dirs := make(map[string]*dir)
for _, name := range names {
f, err := fs.Open(name)