(vhosts []string, next http.Handler)
| 271 | } |
| 272 | |
| 273 | func newVHostHandler(vhosts []string, next http.Handler) http.Handler { |
| 274 | vhostMap := make(map[string]struct{}) |
| 275 | for _, allowedHost := range vhosts { |
| 276 | vhostMap[strings.ToLower(allowedHost)] = struct{}{} |
| 277 | } |
| 278 | return &virtualHostHandler{vhostMap, next} |
| 279 | } |