1
0
mirror of https://github.com/dutchcoders/transfer.sh.git synced 2020-11-18 19:53:40 -08:00

ISSUE-223

This commit is contained in:
Andrea Spacca 2019-05-12 10:14:27 +02:00
parent e7380750f8
commit 6ac8ae20e3

View File

@ -230,6 +230,14 @@ func HttpAuthCredentials(user string, pass string) OptionFn {
} }
func FilterOptions(options IPFilterOptions) OptionFn { func FilterOptions(options IPFilterOptions) OptionFn {
for i, allowedIP := range options.AllowedIPs {
options.AllowedIPs[i] = strings.TrimSpace(allowedIP)
}
for i, blockedIP := range options.BlockedIPs {
options.BlockedIPs[i] = strings.TrimSpace(blockedIP)
}
return func(srvr *Server) { return func(srvr *Server) {
srvr.ipFilterOptions = &options srvr.ipFilterOptions = &options
} }