405 Method Not Allowed, see: https://tools.ietf.org/html/rfc2616#section-10.4.6
(w http.ResponseWriter, r *http.Request, methods ...string)
| 932 | |
| 933 | // 405 Method Not Allowed, see: https://tools.ietf.org/html/rfc2616#section-10.4.6 |
| 934 | func WriteErr405(w http.ResponseWriter, r *http.Request, methods ...string) { |
| 935 | w.Header().Set("Allow", strings.Join(methods, ", ")) |
| 936 | if r.Method == http.MethodOptions { |
| 937 | w.WriteHeader(http.StatusOK) |
| 938 | } else { |
| 939 | http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) |
| 940 | } |
| 941 | } |
| 942 | |
| 943 | ///////////// |
| 944 | // errPool // |
no test coverage detected