在 Apache 上运行 Perl Dancer 时内容长度不正确
我刚刚开始在 Apache 上使用 Perl Dancer 设置应用程序。我使用提供的舞者脚本来设置我的初始目录结构,并且能够将所有设置设置到看到初始“Perl is Dancing”页面的程度。不幸的是,我注意到当我查看源代码时,没有包含 HTML 标记的最后部分。对 Fiddler 的进一步调查发现了以下错误:
内容长度不匹配:响应标头指示 3,168 字节,但服务器发送了 3,364 字节。
看到这一点后,我做了一些额外的实验,通过从命令行调用 app.pl 直接运行 Dancer 应用程序。当我访问该服务器时,我得到了完整的 HTML 标记,并且 Fiddler 没有报告内容长度问题。
有谁知道为什么我在运行 Apache 时可能会看到这个不正确的内容长度问题?我还应该提到,我正在运行生成的 CGI 脚本,该脚本通过 Plack::Runner 调用 app.pl。如果我需要提供更多详细信息,请告诉我。
Dancer版本是1.3030,Plack版本是0.9976。
I am just getting started with setting up an app using Perl Dancer on Apache. I used the provided dancer script to setup my initial directory structure, and was able to get things setup to the point of seeing the initial "Perl is Dancing" page. Unfortunately, I noticed that the very end of the HTML markup is not included when I do a view source. Further investigation with Fiddler revealed the following error:
Content-Length mismatch: Response Header indicated 3,168 bytes, but server sent 3,364 bytes.
After seeing this, I did some additional experimentation, running the Dancer app directly via invoking app.pl from the command line. When I access that server, I get the full HTML markup and not content-length issues are reported by Fiddler.
Does anyone have any ideas why I may be seeing this incorrect content length issue when running through Apache? I should also mention that I am running through the generated CGI script that invokes app.pl via Plack::Runner. Please let me know if I need to provide additional details.
Dancer version is 1.3030 and Plack version is 0.9976.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,普拉克有问题。修订历史提到版本 0.9977 的“修复了 CGI/FastCGI 处理程序以确保换行符不会在 Win32 平台上损坏”(我之前没有提到我在 Win32 上运行)。我将 Plack 更新到最新版本(当前为 0.9978),问题就消失了。
It turns out that there was an issue with Plack. The revision history mentions "Fixed a CGI/FastCGI handler to ensure newlines are not mangled on Win32 platforms" for version 0.9977 (I failed to mention previously that I am running on Win32). I updated Plack to the latest version (currently 0.9978), and the problem went away.