MCPcopy
hub / github.com/NVIDIA/aistore / WriteErr405

Function WriteErr405

cmn/err.go:934–941  ·  view source on GitHub ↗

405 Method Not Allowed, see: https://tools.ietf.org/html/rfc2616#section-10.4.6

(w http.ResponseWriter, r *http.Request, methods ...string)

Source from the content-addressed store, hash-verified

932
933// 405 Method Not Allowed, see: https://tools.ietf.org/html/rfc2616#section-10.4.6
934func 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 //

Callers 15

configHandlerFunction · 0.92
userHandlerMethod · 0.92
tokenHandlerMethod · 0.92
clusterHandlerMethod · 0.92
roleHandlerMethod · 0.92
downloadHandlerMethod · 0.92
daemonHandlerMethod · 0.92
metasyncHandlerMethod · 0.92
metasyncHandlerPutMethod · 0.92
bucketHandlerMethod · 0.92
objectHandlerMethod · 0.92
metasyncHandlerMethod · 0.92

Calls 5

HeaderMethod · 0.80
JoinMethod · 0.80
WriteHeaderMethod · 0.80
SetMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected