RespondBytesWithCode with specified code and bytes.
(w http.ResponseWriter, code int, bs []byte)
| 64 | |
| 65 | // RespondBytesWithCode with specified code and bytes. |
| 66 | func 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. |
no test coverage detected