如何将Perl Dancer设置为默认使用HTTP/1.1应答?我刚刚启动了一个hello world应用程序,使用HTTP/1.1启动了我的curl,它使用HTTP/1.0响应。
foo@deathstar:~/MyWeb-App/lib/MyWeb$ curl -v http://localhost:3000
About to connect() to localhost port 3000 (#0)
> * Trying 127.0.0.1... connected
> * GET / HTTP/1.1
> User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:3000
> Accept: */*
> HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: Perl Dancer 1.311 < Content-Length: 5601 < Content-Type: text/html;
> charset=utf-8 < X-Powered-By: Perl Dancer 1.311发布于 2012-12-06 06:07:01
看起来HTTP协议是硬编码在HTTP::Server::Simple::PSGI中的,这是Dancer在独立模式下运行时使用的。
https://metacpan.org/module/Dancer::Deployment提供了部署应用程序选项的详细信息。
作为一个快速测试,我做了plackup -s Starman -a ./hello_world.pl,它用HTTP/1.1而不是HTTP/1.0响应。
https://stackoverflow.com/questions/13680520
复制相似问题