Browse Source

Merge pull request #137 from dutchcoders/ISSUE-91

Add trailing slash if missing on path options
tags/v1.0.0
Andrea Spacca 5 years ago
committed by GitHub
parent
commit
89e37272ed
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      server/server.go

+ 9
- 0
server/server.go View File

@@ -54,6 +54,7 @@ import (
assetfs "github.com/elazarl/go-bindata-assetfs"

autocert "golang.org/x/crypto/acme/autocert"
"path/filepath"
)

const SERVER_INFO = "transfer.sh"
@@ -109,12 +110,20 @@ func ProfileListener(s string) OptionFn {

func WebPath(s string) OptionFn {
return func(srvr *Server) {
if s[len(s)-1:len(s)] != "/" {
s = s + string(filepath.Separator)
}

srvr.webPath = s
}
}

func TempPath(s string) OptionFn {
return func(srvr *Server) {
if s[len(s)-1:len(s)] != "/" {
s = s + string(filepath.Separator)
}

srvr.tempPath = s
}
}


Loading…
Cancel
Save