HTTP error response handling functions
(w http.ResponseWriter, r *http.Request)
| 382 | // HTTP error response handling functions |
| 383 | |
| 384 | func renderMethodNotAllowed(w http.ResponseWriter, r *http.Request) { |
| 385 | if r.Proto == "HTTP/1.1" { |
| 386 | w.WriteHeader(http.StatusMethodNotAllowed) |
| 387 | w.Write([]byte("Method Not Allowed")) |
| 388 | } else { |
| 389 | w.WriteHeader(http.StatusBadRequest) |
| 390 | w.Write([]byte("Bad Request")) |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | func renderNotFound(w http.ResponseWriter) { |
| 395 | w.WriteHeader(http.StatusNotFound) |
no outgoing calls
no test coverage detected
searching dependent graphs…