mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-26 22:20:18 +01:00
Merge pull request #137 from dutchcoders/ISSUE-91
Add trailing slash if missing on path options
This commit is contained in:
commit
89e37272ed
1 changed files with 9 additions and 0 deletions
|
@ -54,6 +54,7 @@ import (
|
||||||
assetfs "github.com/elazarl/go-bindata-assetfs"
|
assetfs "github.com/elazarl/go-bindata-assetfs"
|
||||||
|
|
||||||
autocert "golang.org/x/crypto/acme/autocert"
|
autocert "golang.org/x/crypto/acme/autocert"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
const SERVER_INFO = "transfer.sh"
|
const SERVER_INFO = "transfer.sh"
|
||||||
|
@ -109,12 +110,20 @@ func ProfileListener(s string) OptionFn {
|
||||||
|
|
||||||
func WebPath(s string) OptionFn {
|
func WebPath(s string) OptionFn {
|
||||||
return func(srvr *Server) {
|
return func(srvr *Server) {
|
||||||
|
if s[len(s)-1:len(s)] != "/" {
|
||||||
|
s = s + string(filepath.Separator)
|
||||||
|
}
|
||||||
|
|
||||||
srvr.webPath = s
|
srvr.webPath = s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TempPath(s string) OptionFn {
|
func TempPath(s string) OptionFn {
|
||||||
return func(srvr *Server) {
|
return func(srvr *Server) {
|
||||||
|
if s[len(s)-1:len(s)] != "/" {
|
||||||
|
s = s + string(filepath.Separator)
|
||||||
|
}
|
||||||
|
|
||||||
srvr.tempPath = s
|
srvr.tempPath = s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue