-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Basic Cookie and Set-Cookie headers implementation. (WIP) #71
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
Basic Cookie and Set-Cookie headers implementation. (WIP) #71
Conversation
The dependencies of cookie-rs are already dependencies in hyper, so that's okay. I'd definitely like to have a |
I don't see any places to use CookieJar in hyper for now. I imagine such flow:
|
For convenience we can create some helpers for the last step: |
I wouldn't be confident in saying that The major questionable dependency is If you guys end up creating your own cookie parser, I also wouldn't mind depending on that for the signing and such! |
I sent two commits that add support of cookie-rs. Now i'm looking for some generic solution to make cookie-rs replaceable. |
I added a default cookie_rs feature to Cargo.toml. One can completely disable cookie-rs and use default |
The last thing we need here is a Set-Cookie's formatter. I don't know the entire hyper codebase enough, so i need advice. I see #72, it is related? |
I'm working on adding support for headers that must output on multiple |
6050ae8
to
7b7bce8
Compare
Maybe we can merge this and implement formatter later? |
We're gonna want to ensure that we design the Header trait to make this safely possible, so I think it's important that we don't merge something that can't work in the future. |
@s-panferov I know you've done a lot of work in this PR, and thank you for that! I want to fix up being able to have multiple header lines, otherwise SetCookie is kind of useless on it's own. I've been busy this week, but I've just finally gotten permission to work on this 1 day out of the work week, so I can do more than just nights/weekends. |
@s-panferov just wanted you to know that I haven't forgotten. Adjust the Header trait to support this has been filed in #80. I've been waiting on associated items to be more fully implemented in rustc before tackling. |
Hi all! What do you think about accepting this MR with limitation to set one SetCookie header? I found out that it is quite enough for simple web-servers to store single cookie with Feel free to say no, I can just use the my own hyper fork to unblock myself while we are waiting. |
@s-panferov I was actually working on this PR today. I'm going to add in a hacky way to produce multiple lines, as so far, this is the only header that needs it, and I want to unblock people. |
closing in favor of #106 |
This piece of code is not finished yet because i have some questions:
Cookie
type from that library to parseCookie
header, but (1) the library has several dependencies and i'm not sure that we want to deal with them and (2) maybe someone wants to use another cookie library. I can leave theCookie
header as-is, use cookie-rs or make some more deep parsing to simple key-value pairs.