1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-28 11:02:02 +03:00

Many improvements to the mas-http crate

- make `mas_http::client` implement Service directly instead of being
   an async function
 - a Get layer that makes a Service<Uri>
 - better error sources in the JSON layer
 - make the client have a proper error type
This commit is contained in:
Quentin Gliech
2022-02-15 08:28:25 +01:00
parent 497a3e006e
commit c5858e6ed5
10 changed files with 260 additions and 53 deletions

View File

@ -65,7 +65,7 @@ impl Options {
json: false,
url,
} => {
let mut client = mas_http::client("cli-debug-http").await?;
let mut client = mas_http::client("cli-debug-http");
let request = hyper::Request::builder()
.uri(url)
.body(hyper::Body::empty())?;
@ -89,7 +89,7 @@ impl Options {
json: true,
url,
} => {
let mut client = mas_http::client("cli-debug-http").await?.json();
let mut client = mas_http::client("cli-debug-http").json();
let request = hyper::Request::builder()
.uri(url)
.body(hyper::Body::empty())?;