-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Cookies #106
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
Cookies #106
Conversation
/// When the user agent generates an HTTP request, the user agent MUST NOT | ||
/// attach more than one Cookie header field. | ||
#[deriving(Clone, PartialEq, Show)] | ||
pub struct Cookies(pub Vec<Cookie>); |
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 see you has removed the ability to use String
here. It is ok, but we need to remove all #[cfg(feature = "cookie_rs")]
and make cookie-rs non-optional.
👍 I have already checked this in a real project. Everything works excellent except the comments. |
@s-panferov ok, rebased in those changes. |
@seanmonstar I have no more comments, everything is ok for me. |
I will take a look tomorrow. |
} | ||
|
||
fn parse_header(raw: &[Vec<u8>]) -> Option<Cookies> { | ||
let mut cookies = vec![]; |
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.
This should use Vec::with_capacity
to avoid resizing.
EDIT: Wait, we don't actually know the exact number of cookies... It could at least start with raw.len()
capacity though, which avoids resizing when there is one cookie per line.
We need to decide on |
@s-panferov I think this handles everything.
cc @reem