-
Notifications
You must be signed in to change notification settings - Fork 122
fix #224 Unable to set multiple cookies in a single web request #237
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
Conversation
jester.nim
Outdated
h[i][1] = value | ||
headers = some(h) | ||
break outer | ||
if key != "Set-cookie": # multiple cookies should be allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to change semantics just for Set-Cookie, would it make sense to allow multiple header values for all keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dom96
Seeing existing code, I thought your design aims for not allowing multiple header for same key. However at least Set-cookie
should allow multiple header.
Would it be better to allow multiple header for any key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just allow multiple headers for every key and accept the fact that HTTP is just a bunch of silly bytes with no underlying design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsumura-h I think so, I'd rather be consistent here.
@dom96 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to ask for changes again, but I think we need another template for this called addHeader
. setHeader
implies that values are overwritten.
@dom96 import jester, httpcore
routes:
get "/":
let headers = @[
("aaa", "111"),
("aaa", "222"),
("aaa", "333"),
("Set-cookie", "aaa"),
("Set-cookie", "bbb"),
]
resp Http200, headers, "test" response header
|
I still don't want the behaviour of |
fix #224 Unable to set multiple cookies in a single web request
multiple cookies should be allowed