mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-27 07:35:56 -05:00
format string readability improvement
This commit is contained in:
parent
321c95a88c
commit
64d161d0a7
@ -126,13 +126,12 @@ pub fn run(args: Args) -> Result<i32, Error> {
|
|||||||
|
|
||||||
fn curl_cookie(cookie: &str, flags: i32, domain: &str) -> String {
|
fn curl_cookie(cookie: &str, flags: i32, domain: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"{httponly}{domain}\t{tailmatch}\t{path}\t{secure}\t{expires}\t{name}\t{value}",
|
"{httponly}{domain}\t{tailmatch}\t{path}\t{secure}\t{expires}\t{name}\t{cookie}",
|
||||||
httponly = if (flags & SessionFlag::HttpOnly as i32) != 0 {
|
httponly = if (flags & SessionFlag::HttpOnly as i32) != 0 {
|
||||||
"#HttpOnly_"
|
"#HttpOnly_"
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
},
|
},
|
||||||
domain = domain,
|
|
||||||
tailmatch = "FALSE",
|
tailmatch = "FALSE",
|
||||||
path = "/",
|
path = "/",
|
||||||
secure = if (flags & SessionFlag::Secure as i32) != 0 {
|
secure = if (flags & SessionFlag::Secure as i32) != 0 {
|
||||||
@ -142,7 +141,6 @@ fn curl_cookie(cookie: &str, flags: i32, domain: &str) -> String {
|
|||||||
},
|
},
|
||||||
expires = "9223372036854775807", // 64-bit CURL_OFF_T_MAX, never expires
|
expires = "9223372036854775807", // 64-bit CURL_OFF_T_MAX, never expires
|
||||||
name = "s",
|
name = "s",
|
||||||
value = cookie
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user