# Set 'Content-Length' Header Field in Body Handler

**URL:** <https://www.ruby-forum.com/t/set-content-length-header-field-in-body-handler/244028>\
**Category:** NGINX\
**Created:** [February 9, 2016, 2:38pm UTC](https://www.ruby-forum.com/t/set-content-length-header-field-in-body-handler/244028 "2016-02-09T14:38:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [February 9, 2016, 2:38pm UTC](https://www.ruby-forum.com/t/set-content-length-header-field-in-body-handler/244028/1 "2016-02-09T14:38:28Z")

</div>

Hello!

I am currently working on a filter module, in which I would like to  
rewrite the content  
received from an upstream. Similar to `gzip` module, I don’t know the  
exact value to  
set to the ‘Content-Length’ header field during filtering the headers of  
the request,  
not only before processing part of the request’s body.

Is there any way I can postpone the transmission of the response headers  
until  
the time this value can be calculated during the filtering of the  
request body?

Thank you in advance!  
Christos Kontas, removed\_email\_address@domain.invalid
