MCPcopy
hub / github.com/gorilla/mux / methodHandler

Function methodHandler

mux_test.go:2185–2192  ·  view source on GitHub ↗

methodHandler writes the method string in response.

(method string)

Source from the content-addressed store, hash-verified

2183
2184// methodHandler writes the method string in response.
2185func methodHandler(method string) http.HandlerFunc {
2186 return func(w http.ResponseWriter, r *http.Request) {
2187 _, err := w.Write([]byte(method))
2188 if err != nil {
2189 log.Printf("Failed writing HTTP response: %v", err)
2190 }
2191 }
2192}
2193
2194// TestMethodsSubrouterCatchall matches handlers for subrouters where a
2195// catchall handler is set for a mis-matching method.

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected