Sanitize config paths
This commit is contained in:
parent
ad8787cab3
commit
de4e848e6d
5
main.go
5
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||||
|
@ -190,7 +191,9 @@ func main() {
|
||||||
|
|
||||||
var c constants
|
var c constants
|
||||||
viper.UnmarshalKey("app", &c)
|
viper.UnmarshalKey("app", &c)
|
||||||
c.AssetPath = filepath.Clean(viper.GetString("app.asset_path"))
|
c.RootURL = strings.TrimRight(c.RootURL, "/")
|
||||||
|
c.UploadURI = filepath.Clean(c.UploadURI)
|
||||||
|
c.AssetPath = filepath.Clean(c.AssetPath)
|
||||||
|
|
||||||
// Initialize the app context that's passed around.
|
// Initialize the app context that's passed around.
|
||||||
app := &App{
|
app := &App{
|
||||||
|
|
Loading…
Reference in New Issue