Skip to content

Commit

Permalink
Merge pull request #2305 from copperlib/master
Browse files Browse the repository at this point in the history
fix web static file path slash error for win platform
  • Loading branch information
sagikazarmark authored Nov 9, 2021
2 parents a86beb8 + 5854dd1 commit 21a8ac6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"net/http"
"net/url"
"path"
"path/filepath"
"sort"
"strings"

Expand Down Expand Up @@ -109,7 +108,7 @@ func loadWebConfig(c webConfig) (http.Handler, http.Handler, *templates, error)
if err != nil {
return nil, nil, nil, fmt.Errorf("read static dir: %v", err)
}
themeFiles, err := fs.Sub(c.webFS, filepath.Join("themes", c.theme))
themeFiles, err := fs.Sub(c.webFS, path.Join("themes", c.theme))
if err != nil {
return nil, nil, nil, fmt.Errorf("read themes dir: %v", err)
}
Expand All @@ -133,7 +132,7 @@ func loadTemplates(c webConfig, templatesDir string) (*templates, error) {
if file.IsDir() {
continue
}
filenames = append(filenames, filepath.Join(templatesDir, file.Name()))
filenames = append(filenames, path.Join(templatesDir, file.Name()))
}
if len(filenames) == 0 {
return nil, fmt.Errorf("no files in template dir %q", templatesDir)
Expand Down

0 comments on commit 21a8ac6

Please sign in to comment.