响应标头中的 Content-Length 替换为 Transfer-Encoding:由 apache 分块

问题描述 投票:0回答:1

在发送大文件流以响应浏览器时,我手动设置的 Content-Length 标头被 Transfer-Encoding 替换:对于所有 >2GB 的文件,在 apache httpd 2.2.23(64 位)中分块。这使得浏览器不确定文件的总大小,因此浏览器下载进度中的总文件大小显示为“?”。对于文件 < 2GB the Content-Length appears just fine. Wondering what could be causing apache to override the Content-Length header with Transfer-Encoding: chunked for large files. How can I prevent this?

我确实尝试打开 mod_deflate 并尝试设置以下环境属性,如在其他一些线程中读取的那样。但没有运气。

    SetEnv force-response-1.0
    SetEnv downgrade-1.0
    SetEnv nokeepalive
apache2
1个回答
0
投票

有一个 Apache 环境变量,用于管理具有 Content-Length 设置的信任类 CGI 脚本。

SetEnv ap_trust_cgilike_cl 1

© www.soinside.com 2019 - 2024. All rights reserved.