We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c07ef99 commit 3c4d221Copy full SHA for 3c4d221
modules/public/public.go
@@ -29,15 +29,11 @@ func AssetsHandler(opts *Options) func(next http.Handler) http.Handler {
29
if !filepath.IsAbs(custPath) {
30
custPath = filepath.Join(setting.AppWorkPath, custPath)
31
}
32
-
33
if !filepath.IsAbs(opts.Directory) {
34
opts.Directory = filepath.Join(setting.AppWorkPath, opts.Directory)
35
36
- if opts.Prefix == "" {
37
- opts.Prefix = "/"
38
- }
39
- if opts.Prefix != "/" {
40
- opts.Prefix = opts.Prefix + "/"
+ if !strings.HasSuffix(opts.Prefix, "/") {
+ opts.Prefix += "/"
41
42
43
return func(next http.Handler) http.Handler {
0 commit comments