Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHttpRequest.sendFile invalid Content-Length when output_handler is ob_gzhandler #4

Closed
qiangxue opened this issue Feb 15, 2012 · 0 comments

Comments

@qiangxue
Copy link
Member

The content length in header will be larger than the real size of the data
sent if gzip(or some other output buffer handler) is enabled.

In my opinion in this case the Content-Length part of the header should be
omitted.

So in CHttpRequest sendFile() method:

header('Content-Length: '.strlen($content));

should be replaced with:

if (strlen(ini_get("output_handler")) == 0)
header('Content-Length: '.strlen($content));

Migrated from http://code.google.com/p/yii/issues/detail?id=788


earlier comments

qiang.xue said, at 2010-01-05T02:05:46.000Z:

@sebastián: could you take a look at this? Please double check to make sure this IS an issue. Thanks.

qiang.xue said, at 2010-02-19T21:47:21.000Z:

This issue was closed by revision r1822.

@vaijanath vaijanath mentioned this issue Oct 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant