mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
client: Add missing timeouts
This commit is contained in:
parent
c171810112
commit
f960971fdb
1 changed files with 2 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ impl Backend {
|
|||
let data = self.get_login_data().ok_or(anyhow!("No login data set!"))?;
|
||||
|
||||
let request = Request::post(format!("{}/login", server_url))
|
||||
.timeout(Duration::from_secs(10))
|
||||
.header("Content-Type", "application/json")
|
||||
.body(serde_json::to_string(&data)?)?;
|
||||
|
||||
|
|
@ -157,6 +158,7 @@ impl Backend {
|
|||
let token = self.get_token().ok_or(anyhow!("No login token!"))?;
|
||||
|
||||
let response = Request::post(format!("{}/{}", server_url, url))
|
||||
.timeout(Duration::from_secs(10))
|
||||
.header("Authorization", format!("Bearer {}", token))
|
||||
.header("Content-Type", "application/json")
|
||||
.body(body)?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue