IPFS Gateway not exposing content-length header when receiving Accept-Encoding
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- networking
调研方向
从 issue 中的两个 curl 复现开始,比较带有和不带有请求标头 Accept-Encoding: gzip 时的响应。阅读链接的 gateway 相关参考资料,以定位受影响的实现或规范;当浏览器或客户端发送 Accept-Encoding 时,响应仍保留正确的 content-length 标头,即表示完成。
由索引模型根据 Issue 内容生成。
描述
At the moment IPFS Gateway does not send content-length header in response when it receives Accept-encoding headers. This is problematic for caching that can only be performed when we know content-length and browsers fetch default to send such headers.
Taking into account https://ipfs.io/ipfs/bafybeib4zuumguq4cgkt7caddeukb4ysijnehvntekrtu5afmet5ujvlka/package.json , we get content-length with CURL, but not browser.
@lidel found out that Accept-Encoding request header was the root problem.
curl -sD - https://ipfs.io/ipfs/bafybeib4zuumguq4cgkt7caddeukb4ysijnehvntekrtu5afmet5ujvlka/package.json | grep -i content-length
curl -sD - -H 'Accept-Encoding: gzip' https://ipfs.io/ipfs/bafybeib4zuumguq4cgkt7caddeukb4ysijnehvntekrtu5afmet5ujvlka/package.json | grep -i content-length
References:
- https://github.com/protocol/bifrost-infra/issues/1868
- https://github.com/nftstorage/nftstorage.link/pull/98
- https://github.com/metacpan/metacpan-api/issues/240#issuecomment-10258159
cc @lidel @thattommyhall @gmasgras
- 主要语言
- HTML
- 星标
- 1.2k
- 派生
- 250
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipfs/specs 的其他 Issue
-
need/triage
难度 2/5 1-3 小时 新手友好度 68/100
-
need/triage
难度 5/5 一周以上 新手友好度 30/100
-
dnslink:// URIs未关闭need/triage
难度 5/5 一周以上 新手友好度 30/100
-
难度 5/5 一周以上 新手友好度 35/100
-
need/triage
难度 3/5 1-2 天 新手友好度 55/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
webtorrent/webtorrent#3131 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100