mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
clean path prefixes.
This commit is contained in:
@@ -197,7 +197,7 @@ func (s *Room) Set() {
|
||||
s.NAT1To1IPs = viper.GetStringSlice("nat1to1")
|
||||
s.NekoImages = viper.GetStringSlice("neko_images")
|
||||
s.NekoPrivilegedImages = viper.GetStringSlice("neko_privileged_images")
|
||||
s.PathPrefix = viper.GetString("path_prefix")
|
||||
s.PathPrefix = path.Join("/", path.Clean(viper.GetString("path_prefix")))
|
||||
s.Labels = viper.GetStringSlice("labels")
|
||||
|
||||
s.StorageEnabled = viper.GetBool("storage.enabled")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"path"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -77,5 +79,5 @@ func (s *Server) Set() {
|
||||
|
||||
s.Admin.Static = viper.GetString("admin.static")
|
||||
s.Admin.Password = viper.GetString("admin.password")
|
||||
s.Admin.PathPrefix = viper.GetString("admin.path_prefix")
|
||||
s.Admin.PathPrefix = path.Join("/", path.Clean(viper.GetString("admin.path_prefix")))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user