Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If there are Multiple set-cookie Maxwell could only get one of them #54

Open
jackalcooper opened this issue Mar 29, 2017 · 4 comments
Open

Comments

@jackalcooper
Copy link
Contributor

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

@zhongwencool
Copy link
Owner

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. :)

@doughsay
Copy link
Collaborator

doughsay commented Apr 3, 2017

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

@zhongwencool
Copy link
Owner

@doughsay Thanks for your advice.
Do you have time to help implement this feature?
Welcome to Maxwell.
:)

@doughsay
Copy link
Collaborator

doughsay commented Apr 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants