mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-01-21 01:12:28 -05:00
Fixed issue #565
Issue fixed by omitting the cookie header when cookie_str is empty
This commit is contained in:
parent
e7b8602e1f
commit
be2916333b
1 changed files with 14 additions and 6 deletions
|
@ -253,6 +253,13 @@ fn get_page(url: &str) -> Result<Response, Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_page_with_cookies(url: &str, cookie_str: &str) -> Result<Response, Error> {
|
fn get_page_with_cookies(url: &str, cookie_str: &str) -> Result<Response, Error> {
|
||||||
|
if cookie_str.is_empty() {
|
||||||
|
CLIENT
|
||||||
|
.get(url)
|
||||||
|
.send()?
|
||||||
|
.error_for_status()
|
||||||
|
.map_err(Into::into)
|
||||||
|
} else {
|
||||||
CLIENT
|
CLIENT
|
||||||
.get(url)
|
.get(url)
|
||||||
.header("cookie", cookie_str)
|
.header("cookie", cookie_str)
|
||||||
|
@ -260,6 +267,7 @@ fn get_page_with_cookies(url: &str, cookie_str: &str) -> Result<Response, Error>
|
||||||
.error_for_status()
|
.error_for_status()
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a Integer with the priority of the type of the icon which to prefer.
|
/// Returns a Integer with the priority of the type of the icon which to prefer.
|
||||||
/// The lower the number the better.
|
/// The lower the number the better.
|
||||||
|
|
Loading…
Add table
Reference in a new issue