rack-zippy icon indicating copy to clipboard operation
rack-zippy copied to clipboard

Set X-Content-Length?

Open iainbryson opened this issue 9 years ago • 1 comments

In the case where there exists both a foo and a foo.gz, can this be enhanced to set the X-Content-Length header to the size of foo when sending foo.gz?

iainbryson avatar Nov 07 '15 19:11 iainbryson

Hi @iainbryson - sorry for the slow response and thanks for the question. I didn't find much information about X-Content-Length.

It'd be possible for rack-zippy or actionpack or rack to handle adding the header. Quite where the better location for inserting the X-Content-Length header is isn't clear to me without more information.

Currently Rack::File handles setting the Content-Length header, and actionpack's Static middleware handles deciding if to serve the .gz file or not.

eliotsykes avatar Nov 21 '15 17:11 eliotsykes