Upgrade ruma

This commit is contained in:
Jonas Platte 2021-04-23 18:45:06 +02:00 committed by Timo Kösters
parent e72fd44bb5
commit d8b484beed
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
6 changed files with 2915 additions and 12 deletions

View file

@ -1,7 +1,8 @@
use crate::{utils, Error, Result};
use bytes::BytesMut;
use http::header::{HeaderValue, CONTENT_TYPE};
use log::warn;
use ruma::api::{IncomingResponse, OutgoingRequest};
use ruma::api::{IncomingResponse, OutgoingRequest, SendAccessToken};
use std::{
convert::{TryFrom, TryInto},
fmt::Debug,
@ -20,8 +21,9 @@ where
let hs_token = registration.get("hs_token").unwrap().as_str().unwrap();
let mut http_request = request
.try_into_http_request(&destination, Some(""))
.unwrap();
.try_into_http_request::<BytesMut>(&destination, SendAccessToken::IfRequired(""))
.unwrap()
.map(|body| body.freeze());
let mut parts = http_request.uri().clone().into_parts();
let old_path_and_query = parts.path_and_query.unwrap().as_str().to_owned();