【发布时间】:2015-03-10 10:35:38
【问题描述】:
我有一个托管在 Heroku 上的应用程序,它似乎在 HTTP/1.1 连接请求的响应标头中添加了 Connection:close,并且不允许我们重新使用持久的 HTTP/1.1 连接。这适用于我在 Heroku 上的其他应用程序,但我不知道为什么它会为这个应用程序这样做。有什么线索吗?
因此,如果我尝试使用 curl 进行测试,
curl -v "http://myapp.herokuapp.com/api/posts/trending" "http://myapp.com/api/posts/trending"
* Connected to myapp.herokuapp.com () port 80 (#0)
> GET /api/posts/trending HTTP/1.1
> User-Agent: curl/7.37.1
> Host: myapp.herokuapp.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: close
< Date: Mon, 09 Mar 2015 20:54:15 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Expires: 0
< Content-Type: application/json;charset=UTF-8
* Server Jetty(9.2.7.v20150116) is not blacklisted
< Server: Jetty(9.2.7.v20150116)
< Via: 1.1 vegur
...response...
* Closing connection 0
【问题讨论】: