(w http.ResponseWriter, code int, message string)
| 42 | } |
| 43 | |
| 44 | func RespondWithError(w http.ResponseWriter, code int, message string) { |
| 45 | log := ctrllog.Log.WithName("http-helpers") |
| 46 | log.Info("Responding with error", "statusCode", code, "message", message) |
| 47 | |
| 48 | RespondWithJSON(w, code, map[string]string{"error": message}) |
| 49 | } |
| 50 | |
| 51 | func GetUserID(r *http.Request) (string, error) { |
| 52 | p, err := GetPrincipal(r) |
no test coverage detected