Skip to content
Snippets Groups Projects
Commit 656b326a authored by rswindell's avatar rswindell
Browse files

Added TODO comment regarding the lack of a Content-Length header field

in GET responses when Connection: Keep-Alive is not enabled.
parent 6919a3a2
Branches
Tags
No related merge requests found
...@@ -1339,6 +1339,10 @@ static BOOL send_headers(http_session_t *session, const char *status, int chunke ...@@ -1339,6 +1339,10 @@ static BOOL send_headers(http_session_t *session, const char *status, int chunke
} }
/* DO NOT send a content-length for chunked */ /* DO NOT send a content-length for chunked */
/* TODO: Why aren't we sending a Content-Length header for GET responses?
* Per RFC 2068 (HTTP/1.1):
* "it SHOULD be sent whenever the message's length can be determined prior to being transferred"
*/
if(send_entity) { if(send_entity) {
if((session->req.keep_alive || session->req.method == HTTP_HEAD) && session->req.dynamic!=IS_CGI&& session->req.dynamic!=IS_FASTCGI && (!chunked)) { if((session->req.keep_alive || session->req.method == HTTP_HEAD) && session->req.dynamic!=IS_CGI&& session->req.dynamic!=IS_FASTCGI && (!chunked)) {
if(ret) { if(ret) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment