Mercurial > crates > nonstick
comparison pam-http/src/lib.rs @ 19:d654aa0655e5
Making PamHandle a struct with methods
author | Anthony Nowell <anthony@algorithmia.com> |
---|---|
date | Mon, 25 Sep 2017 23:42:35 -0600 |
parents | 27730595f1ea |
children | 734ca62159fb |
comparison
equal
deleted
inserted
replaced
18:0f5e9e8963ae | 19:d654aa0655e5 |
---|---|
63 | 63 |
64 PamResultCode::PAM_SUCCESS | 64 PamResultCode::PAM_SUCCESS |
65 } | 65 } |
66 | 66 |
67 fn get_url(url: &str, user: &str, password: Option<&str>) -> reqwest::Result<StatusCode> { | 67 fn get_url(url: &str, user: &str, password: Option<&str>) -> reqwest::Result<StatusCode> { |
68 let client = Client::builder()?.timeout(Duration::from_secs(5)).build()?; | 68 let client = Client::builder()?.timeout(Duration::from_secs(15)).build()?; |
69 client.get(url)? | 69 client.get(url)? |
70 .basic_auth(user, password) | 70 .basic_auth(user, password) |
71 .send() | 71 .send() |
72 .map(|r| r.status()) | 72 .map(|r| r.status()) |
73 } | 73 } |