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

SetCookie can't be constructed due to private field #40

Open
lnicola opened this issue Jan 28, 2019 · 1 comment
Open

SetCookie can't be constructed due to private field #40

lnicola opened this issue Jan 28, 2019 · 1 comment

Comments

@lnicola
Copy link
Contributor

lnicola commented Jan 28, 2019

The inner field of SetCookie is private, so it can't be constructed by the users of the crate.

@kaj
Copy link

kaj commented Apr 22, 2019

Some kind of semantic constructor would be nice, maybe using a builder pattern, to make it possible to do something like:

    Response::builder()
        .something()
        .typed_header(SetCookie::build("NAME")
            .same_site_strict()
            .http_only()
            .value("value"),
        )
        .body(something)

(The typed_header method on a response builder is suggested in #42)

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

2 participants