(f http.HandlerFunc)
| 90 | } |
| 91 | |
| 92 | func (h *HttpServer) middleware(f http.HandlerFunc) http.Handler { |
| 93 | if h.options.Username == "" { |
| 94 | return f |
| 95 | } else { |
| 96 | return httpauth.SimpleBasicAuth(h.options.Username, h.options.Password)(f) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func NewHTTPServer( |
| 101 | addr string, |