Cneonction和nnCoection HTTP标头 [英] Cneonction and nnCoection HTTP headers

查看:402
本文介绍了Cneonction和nnCoection HTTP标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在Web上的互操作性方面经常遇到一些问题。浏览器供应商的这些问题之一是拼写错误的 Connection HTTP标头。最常见的错误是由这两种形式给出的。

We have often some issues in terms of interoperability on the Web. One of these issues for browsers vendors is the wrongly spelled Connection HTTP header. The most common errors are given by these two forms.

nnCoection:
Cneonction:

有一些关于此的文章,包括有趣的HTTP标题。通常它会在一段时间内发生,然后消失。似乎其中一些是由负载均衡器创建的,例如此示例:NetScaler Appliance。

There are has been a few articles about this, including Fun with HTTP headers. Often it is happening by period, then disappear. It seems that some of them are created by load balancers such as this example: NetScaler Appliance.

您是否知道造成这些问题的任何其他硬件或软件实例?

Do you know any other instances of hardware or software that create these issues?

更新这里有一个例子,其中一个网站没有发回好的连接 HTTP标头。

Update Here an example among others of a site which doesn't send back a good Connection HTTP header.

curl -sI ehg-nokiafin.hitbox.com
HTTP/1.1 200 OK
Date: Tue, 25 Jan 2011 20:35:45 GMT
Server: Hitbox Gateway 9.3.6-rc1
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP LAW NID PSA ADM OUR IND NAV COM"
Cneonction: close
Pragma: no-cache
Cache-Control: max-age=0, private, proxy-revalidate
Expires: Tue, 25 Jan 2011 20:35:46 GMT
Content-Type: text/plain
Content-Length: 23

更新2011-01-26

在关于AWS的亚马逊论坛上,有一个主题关于 nnCoection 。评论说:

On Amazon forum about AWS, there is a thread about nnCoection. A comment says:


仅供参考,它错误拼写单词
连接的原因是互联网
检查 - sum(一个简单的总和)仍然会增加
,这样改变可以发生在
的数据包级别。如果它完全
删除了标题,它将不得不
停止转发响应,直到
标题被完全读取,所以它
可以重写标题,重新计算
校验和然后发送它。

FYI, the reason it misspells the word connection is so that the internet check-sum (a simple sum) still adds up, this way the change can occur at the packet level. If it completely removed the header, it would have to stall forwarding the response until the header was entirely read, so it could rewrite the headers, recompute the checksum and then send it along.

with

sum(ord(c) for c in "Connection")

sum(ord(c) for c in "nnCoection")

两者都给出1040

推荐答案

你确定这是一个实际的问题的?链接的文章表明,这些类型的标题是故意拼写错误,因此负载平衡器,反向代理或其他中间件可能会破坏服务器保持连接保持活动的愿望,而无需跟踪TCP流中的增量。生命的联系。这样的事情实际上可能是必要的,通过强制保持活动连接到其他服务器迁移到联机的服务器,使被击倒和恢复的服务器恢复到现役状态。

Are you sure it's an actual issue? The linked article suggests that these sorts of headers are "misspelled on purpose" so that a load balancer, reverse proxy or other middlebox can defeat the server's wishes that the connection be kept alive, without having to track a delta in TCP stream position over the life of the connection. Something like this may actually be necessary to bring a downed and recovered server back into active duty, by forcing kept-alive connections to other servers to migrate to the one brought online.

如果你的协议依赖于HTTP 连接:keep-alive 来运行( cough ),你可能做错了。

If you have a protocol that's dependent on HTTP Connection: keep-alive to function (cough), you're probably doing it wrong.

这篇关于Cneonction和nnCoection HTTP标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆