(w http.ResponseWriter, status int, code, desc string)
| 112 | } |
| 113 | |
| 114 | func writeOAuthError(w http.ResponseWriter, status int, code, desc string) { |
| 115 | w.Header().Set("Content-Type", "application/json") |
| 116 | w.Header().Set("Cache-Control", "no-store") |
| 117 | w.WriteHeader(status) |
| 118 | _ = json.NewEncoder(w).Encode(OAuthError{Error: code, ErrorDescription: desc}) |
| 119 | } |
| 120 | |
| 121 | // dcrSourceIP returns the per-IP key for DCR rate-limiting. DCR is |
| 122 | // the only anonymous persistent-write endpoint; we can't trust |
no test coverage detected