(h http.Handler)
| 619 | } |
| 620 | |
| 621 | func localhostMiddleware(h http.Handler) http.Handler { |
| 622 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 623 | if addressIsLocalhost(r.Host) { |
| 624 | h.ServeHTTP(w, r) |
| 625 | return |
| 626 | } |
| 627 | |
| 628 | http.Error(w, "Host check error", http.StatusForbidden) |
| 629 | }) |
| 630 | } |
| 631 | |
| 632 | func (s *service) getPendingDevices(w http.ResponseWriter, _ *http.Request) { |
| 633 | devices, err := s.model.PendingDevices() |
no test coverage detected