The spec says about message body the following: * * All responses to the HEAD and CONNECT request method * MUST NOT include a message-body, even though the presence * of entity-header fields might lead one to believe they do. * * All 1xx (informational), 204 (no content), and 304 (not modified) * responses MUST NOT include a message-body. * * Refer : [https://tools.ietf.org/html/rfc7231#s
| 1170 | * Refer : [https://tools.ietf.org/html/rfc7231#section-4.3.6] |
| 1171 | */ |
| 1172 | inline bool |
| 1173 | is_response_body_precluded(HTTPStatus status_code) |
| 1174 | { |
| 1175 | if (((status_code != HTTP_STATUS_OK) && |
| 1176 | ((status_code == HTTP_STATUS_NOT_MODIFIED) || ((status_code < HTTP_STATUS_OK) && (status_code >= HTTP_STATUS_CONTINUE)) || |
| 1177 | (status_code == HTTP_STATUS_NO_CONTENT)))) { |
| 1178 | return true; |
| 1179 | } else { |
| 1180 | return false; |
| 1181 | } |
| 1182 | } |
| 1183 | |
| 1184 | inline bool |
| 1185 | is_response_body_precluded(HTTPStatus status_code, int method) |
no outgoing calls
no test coverage detected