给定 TCP/IP 校验和的 HTTP 1.1 内容 MD5 冗余?
我只是想知道,在HTTP 1.1规范中,有一个字段Content-MD5。然而,由于 HTTP 在整个 OSI 堆栈中位于 TCP/IP 之上,并且考虑到 TCP/IP 有一个标头校验和来确保检查所有传输的数据,我很好奇为什么在 HTTP 中需要 Content-MD5 1.1 规格?我是否误解或遗漏了什么?
对于 HTTP/1.1 标头规范,我参考了:
http:// www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.15
对于 TCP/IP 规范,我参考了第 3.1 节:
http://www.ietf.org/rfc/rfc791.txt
对我来说,通过在 HTTP 标头中添加 Content-MD5,我们只是添加更多要在服务器上完成的工作。为什么不直接使用 TCP/IP 已经提供的机制呢?
提前欢呼并感谢所有人:)
I was just wondering, in the HTTP 1.1 specifications, there is a field Content-MD5. However, since HTTP ride atop TCP/IP in the entire OSI Stack, and given that TCP/IP has a Header Checksum to ensure that all data transmitted is checked, I am curious as to why the need for a Content-MD5 in the HTTP 1.1 specifications? Did I misunderstand or miss out something?
For the HTTP/1.1 header specs I referred to:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.15
For the TCP/IP specs I referred to section 3.1 at:
http://www.ietf.org/rfc/rfc791.txt
To me, by adding the Content-MD5 in the HTTP header, we're just adding more work to be done at the server. Why not just use the mechanisms that TCP/IP already provides?
Cheers and thanks to all in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
HTTP 内容 MD5 值独立有用。
TCP 校验和非常弱,考虑到 Internet 上传输的数据量,TCP 校验和值很可能会出现静默故障。
然而,如果您真的很在意,您会想使用更强大的东西,例如 TLS。
The HTTP content MD5 value is independently useful.
The TCP checksum is pretty weak, and given the amount of data transmitted on the Internet, it is quite likely that there are silent failures of the TCP checksum value.
If you really care, however, you want to use something stronger, like TLS.
我认为它是为了帮助客户端确定代理服务器是否扰乱了传输中的内容。您仍然可能拥有有效的 TCP 数据包,但内容无效。
I would assume it's to help the client determine if a proxy server scrambled the content in transit. You could still have valid TCP packets but invalid content.