Skip to content

Commit a640d62

Browse files
committed
Update our usage of conduit-cookie to match its new API
1 parent 445df05 commit a640d62

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ chrono = "0.4.0"
5353
conduit = "0.8"
5454
conduit-conditional-get = "0.8"
5555
conduit-cookie = "0.8"
56+
cookie = "0.9"
5657
conduit-json-parser = "0.8"
5758
conduit-log-requests = "0.8"
5859
conduit-middleware = "0.8"

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern crate url;
4242
extern crate conduit;
4343
extern crate conduit_conditional_get;
4444
extern crate conduit_cookie;
45+
extern crate cookie;
4546
extern crate conduit_git_http_backend;
4647
extern crate conduit_json_parser;
4748
extern crate conduit_log_requests;
@@ -192,9 +193,10 @@ pub fn middleware(app: Arc<App>) -> MiddlewareBuilder {
192193
}
193194
m.around(util::Head::default());
194195
m.add(conduit_conditional_get::ConditionalGet);
195-
m.add(conduit_cookie::Middleware::new(app.session_key.as_bytes()));
196+
m.add(conduit_cookie::Middleware::new());
196197
m.add(conduit_cookie::SessionMiddleware::new(
197198
"cargo_session",
199+
cookie::Key::from_master(app.session_key.as_bytes()),
198200
env == Env::Production,
199201
));
200202
m.add(app::AppMiddleware::new(app));

src/tests/all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn app() -> (record::Bomb, Arc<App>, conduit_middleware::MiddlewareBuilder) {
120120

121121
let config = cargo_registry::Config {
122122
uploader: uploader,
123-
session_key: "test".to_string(),
123+
session_key: "test this has to be over 32 bytes long".to_string(),
124124
git_repo_checkout: git::checkout(),
125125
gh_client_id: env::var("GH_CLIENT_ID").unwrap_or(String::new()),
126126
gh_client_secret: env::var("GH_CLIENT_SECRET").unwrap_or(String::new()),

0 commit comments

Comments
 (0)