MCPcopy Create free account
hub / github.com/apache/trafficserver / is_response_body_precluded

Function is_response_body_precluded

include/proxy/http/HttpTransact.h:1172–1182  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1170 * Refer : [https://tools.ietf.org/html/rfc7231#section-4.3.6]
1171 */
1172inline bool
1173is_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
1184inline bool
1185is_response_body_precluded(HTTPStatus status_code, int method)

Calls

no outgoing calls

Tested by

no test coverage detected