Github user ffcai commented on the pull request:

    https://github.com/apache/trafficserver/pull/216#issuecomment-111045489
  
    Hi @adityaumrani , for *POST/PUT* method, `Content-Length` should present 
or use Chunked Transfer Encoding (present `Transfer-Encoding: chunked`). And, 
ATS has a dedicated function - `HttpTransact::check_request_validity` for this 
check.
    ```cpp
        // Require Content-Length/Transfer-Encoding for POST/PUSH/PUT
        if ((scheme == URL_WKSIDX_HTTP || scheme == URL_WKSIDX_HTTPS) &&
            (method == HTTP_WKSIDX_POST || method == HTTP_WKSIDX_PUSH || method 
== HTTP_WKSIDX_PUT) &&
            s->client_info.transfer_encoding != CHUNKED_ENCODING) {
          if ((s->txn_conf->post_check_content_length_enabled) && 
!incoming_hdr->presence(MIME_PRESENCE_CONTENT_LENGTH)) {
            return NO_POST_CONTENT_LENGTH;
          }
          if (HTTP_UNDEFINED_CL == s->hdr_info.request_content_length) {
            return INVALID_POST_CONTENT_LENGTH;
          }
        }
      }
    ```
    
https://github.com/apache/trafficserver/blob/master/proxy/http/HttpTransact.cc#L5282
    
    I think we can just skip doing this here and let the function check it some 
later.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to