MCPcopy
hub / github.com/uber/aresdb / RespondBytesWithCode

Function RespondBytesWithCode

api/common/response.go:66–72  ·  view source on GitHub ↗

RespondBytesWithCode with specified code and bytes.

(w http.ResponseWriter, code int, bs []byte)

Source from the content-addressed store, hash-verified

64
65// RespondBytesWithCode with specified code and bytes.
66func RespondBytesWithCode(w http.ResponseWriter, code int, bs []byte) {
67 setCommonHeaders(w)
68 w.WriteHeader(code)
69 if bs != nil {
70 w.Write(bs)
71 }
72}
73
74// writeJSONBytes write jsonBytes to response if err is nil otherwise respond
75// with a ErrFailedToJSONMarshalResponseBody.

Callers 1

HealthCheckMethod · 0.92

Calls 3

setCommonHeadersFunction · 0.85
WriteHeaderMethod · 0.80
WriteMethod · 0.65

Tested by

no test coverage detected