melib/jmap: add HTTP redirect policy to client
Meli currently uses the .well-known/jmap URL and the RFC8620 requires that any redirects are followed (https://tools.ietf.org/html/rfc8620#section-2.2). This small change allows redirects to happen.jmap-eventsource
parent
6cc43540d6
commit
f1bdae65ee
|
@ -24,6 +24,7 @@ use crate::conf::AccountSettings;
|
|||
use crate::email::*;
|
||||
use crate::error::{MeliError, Result};
|
||||
use futures::lock::Mutex as FutureMutex;
|
||||
use isahc::config::RedirectPolicy;
|
||||
use isahc::prelude::HttpClient;
|
||||
use isahc::ResponseExt;
|
||||
use serde_json::Value;
|
||||
|
|
|
@ -35,6 +35,7 @@ impl JmapConnection {
|
|||
pub fn new(server_conf: &JmapServerConf, store: Arc<Store>) -> Result<Self> {
|
||||
let client = HttpClient::builder()
|
||||
.timeout(std::time::Duration::from_secs(10))
|
||||
.redirect_policy(RedirectPolicy::Limit(10))
|
||||
.authentication(isahc::auth::Authentication::basic())
|
||||
.credentials(isahc::auth::Credentials::new(
|
||||
&server_conf.server_username,
|
||||
|
|
Loading…
Reference in New Issue