Skip to content

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

Merged
merged 7 commits into from
Nov 10, 2014
Merged

Cookies #106

merged 7 commits into from
Nov 10, 2014

Conversation

seanmonstar
Copy link
Member

@s-panferov I think this handles everything.

cc @reem

/// 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>);
Copy link
Contributor

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.

@s-panferov
Copy link
Contributor

👍 I have already checked this in a real project. Everything works excellent except the comments.

@seanmonstar
Copy link
Member Author

@s-panferov ok, rebased in those changes.

@s-panferov
Copy link
Contributor

@seanmonstar I have no more comments, everything is ok for me.

@reem
Copy link
Contributor

reem commented Nov 9, 2014

I will take a look tomorrow.

}

fn parse_header(raw: &[Vec<u8>]) -> Option<Cookies> {
let mut cookies = vec![];
Copy link
Contributor

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.

@reem
Copy link
Contributor

reem commented Nov 10, 2014

We need to decide on [] vs &* as a conventions thing.

seanmonstar added a commit that referenced this pull request Nov 10, 2014
@seanmonstar seanmonstar merged commit 0500b5f into master Nov 10, 2014
@reem reem deleted the cookies branch November 10, 2014 21:13
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

Successfully merging this pull request may close these issues.

3 participants