回复:Content-Length 标头与 500(原主题:身份验证、JSON RPC 与 Python)
原始发布页
打开来源页面查看 1 个交叉存档
引用 gavinandresen 于 2010 年 8 月 3 日 06:56:44 PM 的发言
引用 jgarzik 于 2010 年 8 月 3 日 06:09:08 PM 的发言
比特币要求有 Content-Length 标头,但有几个 JSON-RPC 库并不提供它。当缺少 Content-Length 标头时,比特币会返回 500 Internal Server Error。
你能更具体地说说哪些 JSON 库不提供 Content-Length 吗?最好能把这记录到文档中。
我想我们应该尽量支持没有 Content-Length 参数的情况。不过我不想拆掉并替换流,即使这意味着它必须一次读取一个字符。
编辑:也就是说,前提是确实存在不支持 Content-Length 的库。
英文原文
展开英文原文
Quote from: gavinandresen on August 03, 2010, 06:56:44 PM
Quote from: jgarzik on August 03, 2010, 06:09:08 PM
bitcoin requires the Content-Length header, but several JSON-RPC libraries do not provide it. When the Content-Length header is absent, bitcoin returns 500 Internal Server Error.
Can you be more specific about which JSON libraries don't provide Content-Length ? It'd be nice to document that.
I guess we should try to support the case where there's no Content-Length parameter. I don't want to rip and replace streams though, even if it has to read one character at a time.
Edit: That is, assuming there actually are any libraries that don't support Content-Length.