Merge branch 'dont-expect-reqwest-http-request' into 'next'
fix: do not expect that all http requests are valid reqwest requests Closes #396 See merge request famedly/conduit!611
This commit is contained in:
commit
6c3ce71304
5 changed files with 28 additions and 30 deletions
|
@ -66,8 +66,7 @@ impl Service {
|
|||
})?
|
||||
.map(|body| body.freeze());
|
||||
|
||||
let reqwest_request = reqwest::Request::try_from(http_request)
|
||||
.expect("all http requests are valid reqwest requests");
|
||||
let reqwest_request = reqwest::Request::try_from(http_request)?;
|
||||
|
||||
// TODO: we could keep this very short and let expo backoff do it's thing...
|
||||
//*reqwest_request.timeout_mut() = Some(Duration::from_secs(5));
|
||||
|
|
|
@ -512,10 +512,8 @@ impl Service {
|
|||
)
|
||||
.await
|
||||
{
|
||||
None => Ok(kind.clone()),
|
||||
Some(op_resp) => op_resp
|
||||
.map(|_response| kind.clone())
|
||||
.map_err(|e| (kind.clone(), e)),
|
||||
Ok(_) => Ok(kind.clone()),
|
||||
Err(e) => Err((kind.clone(), e)),
|
||||
};
|
||||
|
||||
drop(permit);
|
||||
|
@ -710,7 +708,7 @@ impl Service {
|
|||
&self,
|
||||
registration: Registration,
|
||||
request: T,
|
||||
) -> Option<Result<T::IncomingResponse>>
|
||||
) -> Result<Option<T::IncomingResponse>>
|
||||
where
|
||||
T: Debug,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue