【问题标题】:Heroku router closing persistent http/1.1 connection requests?Heroku 路由器关闭持久的 http/1.1 连接请求?
【发布时间】: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

【问题讨论】:

    标签: http heroku


    【解决方案1】:

    根据 Heroku Support 的说法,在这里回答我自己的问题,这是 Heroku 路由器的已知限制,因为 Jetty 在设计的 HTTP/1.1 请求的响应中不发送 Connection: keep-alive。目前没有建议的解决方法。

    【讨论】:

    • 我也遇到了同样的问题...你终于找到解决方案了吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 1970-01-01
    • 1970-01-01
    • 2014-09-27
    • 2013-10-04
    • 1970-01-01
    相关资源
    最近更新 更多