Cookie module issues
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先检查 hackney_cookie 模块和 hackney:cookies(Headers) 入口点,包括 PR #193 所涉及的行为。将 parser 和 builder 与 RFC6265 进行比较,然后检查项目中使用的不同 cookie 表示形式。完成的标准是正确解析 Set-Cookie 和构建 Cookie,并就一致的表示形式达成共识。
由索引模型根据 Issue 内容生成。
描述
It seems that cookie parser in hackney_cookie uses 'Cookie' parser to parse 'Set-Cookie' header and 'Set-Cookie' builder to build 'Cookie' header. Also code seems to be outdated as it tries to parse comma as valid separator, that not the case in last RFC6265.
As one particular problem that I'm run into is parser failing to proceed set-cookie with Expires attribute. If you try to request https://ya.ru it sets yandexuid cookie and removes S cookie (with Expires in past), but hackney:cookie silently ignores this:
> {ok, Status, Headers, Client} = hackney:request(get, "https://ya.ru", [], <<>>, []).
...
> Headers.
[{<<"Server">>,<<"nginx">>},
{<<"Date">>,<<"Fri, 12 Jun 2015 11:21:05 GMT">>},
{<<"Content-Type">>,<<"text/html; charset=UTF-8">>},
{<<"Content-Length">>,<<"9627">>},
{<<"Connection">>,<<"close">>},
{<<"Cache-Control">>,
<<"no-cache,no-store,max-age=0,must-revalidate">>},
{<<"Expires">>,<<"Fri, 12 Jun 2015 11:21:05 GMT">>},
{<<"Last-Modified">>,<<"Fri, 12 Jun 2015 11:21:05 GMT">>},
{<<"P3P">>,
<<"policyref=\"/w3c/p3p.xml\", CP=\"NON DSP ADM DEV PSD IVDo OUR IND STP PHY P"...>>},
{<<"Set-Cookie">>,
<<"S=; Expires=Tue, 14-Jun-2005 11:21:05 GMT; Path=/">>},
{<<"Set-Cookie">>,
<<"yandexuid=6091834691434108065; Expires=Mon, 09-Jun-2025 11:21:05"...>>},
{<<"X-Frame-Options">>,<<"DENY">>}]
> hackney:cookies(Headers).
[]
This particular problem addressed in PR #193.
But I think cookie module need more attention to implement proper 'Set-Cookie' parser and 'Cookie' builder with respect to RFC6265.
Another issue is that different cookies representations are used across project like {Name, Value}, {Name, [{Name,Value}|Attrs]}, {Name, Value, Attrs}. This adds complexity to lib usage and can be source of errors, maybe it make sense to go with some unified representation based on record or map.
- 主要语言
- Erlang
- 星标
- 1.4k
- 派生
- 458
- 平均合并
- 11 小时 32 分钟
- 30 天内合并 PR
- 47
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
benoitc/hackney 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 58/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
Natvs/Nt.Automaton#33 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
volcano-sh/volcano#6322 ·
维护者通常 1 天内回复
-
claude
难度 2/5 1-3 小时 新手友好度 74/100
sprain/sprainocchio#38 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
peach-mitao/peach#693 ·
维护者通常 1 天内回复