maxwell
maxwell copied to clipboard
If there are Multiple set-cookie Maxwell could only get one of them
Set-Cookie: mx_access_token=UEex53L7ZWRYYr1slF65uH7UpY9XkkdPCpyB7T8j4VBHsYwz; path=/mxpp; HttpOnly
Set-Cookie: mx_network_id=2; path=/mxpp; HttpOnly
Set-Cookie: mx_sso_token=5QIAAOIO6buxYtioPreShjssnd-tsFLHvfcAXYmqzYk-Yi1N; path=/; HttpOnly
Set-Cookie: _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWQ2ZjQ3MDk3OGM1MjRlZjVhMjhjODQ2ZDFjYmJjYzdjBjsAVEkiHHdhcmRlbi51c2VyLmFjY291bnQua2V5BjsAVGkCaAI%3D--5d25e670ea13c0addd8d98cd764c843cc8473802; path=/; HttpOnly
Multiple set-cookies but the resp_headers
is a Map
we need add resp_cookies
, req_cookies
in conn, and implement put_req_cookies/3
and get_resp_cookies/2
,
just like:
https://github.com/elixir-lang/plug/blob/master/lib/plug/conn.ex#L849
Any other solution ?
But I don't have time to implement this right now,
a PR will be appreciated. :)
RFC 2616 specifies multiple copies of the same header may be present in a request. The right solution here (regardless of the above cookie suggestion) is to switch Maxwell.Conn
to use a keyword list instead of a map for headers. This is what Plug.Conn
does.
See here for Plug: https://hexdocs.pm/plug/Plug.Conn.html#t:headers/0
@doughsay Thanks for your advice. Do you have time to help implement this feature? Welcome to Maxwell. :)
I'll take a look, but probably won't be able to get to it until next weekend, but yeah I'll try and give it a shot! ;)
On Tue, Apr 4, 2017, 6:52 PM 某文 [email protected] wrote:
@doughsay https://github.com/doughsay Thanks for your advice. Do you have time to help implement this feature? Welcome to Maxwell. :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zhongwencool/maxwell/issues/54#issuecomment-291710828, or mute the thread https://github.com/notifications/unsubscribe-auth/AANh_UAHA38bhuvAAlml2jDQF358dgrIks5rsvPhgaJpZM4Msanw .