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

Cookie handling in adapters? #241

Open
rfestag opened this issue Feb 3, 2017 · 0 comments
Open

Cookie handling in adapters? #241

rfestag opened this issue Feb 3, 2017 · 0 comments

Comments

@rfestag
Copy link
Contributor

rfestag commented Feb 3, 2017

I ran into an issue trying to update webmachine-test to support cookie sessions (ie, keeping track of all cookies set by the server and automatically responding with them to emulate what browsers do on multi-request tests). I assumed that, at some point in Webmachine's core logic, it would be converting the Set-Cookie header array to a string. It looks like that isn't the case...instead, the adapters appear to handle it as a special case.

Would it be better if set_cookie only worked with strings, and always just concatenated new cookies to the string? Or is there some reason why special handling is done in the adapters (

cookies = [response.headers['Set-Cookie'] || []].flatten
)? I'm happy to work around it in whatever way makes sense, but it seems to me that the values of headers are always strings, and we should probably consistently represent it that way in the core logic, rather than leaving it to adapters to know which headers could be "multi value" and format them correctly.

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

1 participant