Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conten-Length header in response is not present

Tags:

yesod

I have noticed that my yesod site does not respond with Content-Length header.

I have tried to add it with addHeader (in the Handler) with no result.

I am sure that I am missing something very fundamental, but do not see it.

My handlers are Handler Html handlers. I have suceeded adding a custom header using addHeader right before defaultLayout...

like image 897
user2369060 Avatar asked Dec 30 '25 12:12

user2369060


1 Answers

Content-Length is a special header, in the sense that its presence when incorrect will mess up your response. A number of different components will end up stripping it out. My guess in this case is that your response is being GZIP compressed, which necessarily removes the content-length header.

like image 170
Michael Snoyman Avatar answered Jan 01 '26 00:01

Michael Snoyman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!