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 {
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) {
srvr.ipFilterOptions = &options
}