Skip to content

Commit

Permalink
fix cookie lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dadleyy committed Jul 9, 2022
1 parent 09f4ec5 commit f4059e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion workspace/bankah/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bankah"
version = "0.4.6"
version = "0.4.8"
edition = "2018"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion workspace/stickbot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stickbot"
version = "0.4.6"
version = "0.4.8"
edition = "2018"

[lib]
Expand Down
10 changes: 5 additions & 5 deletions workspace/stickbot/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pub use tide::{Body, Error, Redirect, Response, Result};
pub type Request = tide::Request<crate::Services>;

pub fn cookie(request: &Request) -> Option<Cookie<'static>> {
request
.header("Cookie")
.and_then(|list| list.get(0))
.map(|value| value.to_string())
.and_then(|cook| Cookie::parse(cook).ok())
let session_cookie = request.cookie(crate::constants::STICKBOT_COOKIE_NAME)?;

log::debug!("found cookie header - {session_cookie:?}");

Some(session_cookie)
}
2 changes: 1 addition & 1 deletion workspace/twowaiyo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "twowaiyo"
version = "0.4.6"
version = "0.4.8"
edition = "2018"

[lib]
Expand Down

0 comments on commit f4059e3

Please sign in to comment.