Fixed issue #565

Issue fixed by omitting the cookie header when cookie_str is empty
This commit is contained in:
BlackDex 2019-10-05 15:45:09 +02:00
parent e7b8602e1f
commit be2916333b

View File

@ -253,12 +253,20 @@ 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> {
CLIENT if cookie_str.is_empty() {
.get(url) CLIENT
.header("cookie", cookie_str) .get(url)
.send()? .send()?
.error_for_status() .error_for_status()
.map_err(Into::into) .map_err(Into::into)
} else {
CLIENT
.get(url)
.header("cookie", cookie_str)
.send()?
.error_for_status()
.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.