mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
chore(deps): Update Ruma
This commit is contained in:
7 files changed
+49
-41
No files matched your search
@@ -1,6 +1,5 @@
|
||||
use std::{borrow::Cow, fmt::Debug, mem, time::Instant};
|
||||
|
||||
use bytes::Bytes;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug, debug_error, debug_info, debug_warn, err, trace,
|
||||
utils::response::LimitReadExt,
|
||||
@@ -11,7 +10,8 @@ use resolvematrix::resolution::Resolution;
|
||||
use ruma::{
|
||||
ServerName,
|
||||
api::{
|
||||
EndpointError, IncomingResponse, OutgoingRequest, OutgoingRequestExt, SupportedVersions,
|
||||
EndpointError, IncomingResponseExt, OutgoingRequest, OutgoingRequestExt,
|
||||
SupportedVersions,
|
||||
auth_scheme::{AuthScheme, NoAuthentication},
|
||||
error::Error as RumaError,
|
||||
federation::authentication::{ServerSignatures, ServerSignaturesInput},
|
||||
@@ -232,8 +232,12 @@ impl super::Service {
|
||||
let response =
|
||||
into_http_response(dest, actual, method, url, response, size_limit).await?;
|
||||
|
||||
T::IncomingResponse::try_from_http_response(response)
|
||||
.map_err(|e| err!(BadServerResponse("Server returned bad 200 response: {e:?}")))
|
||||
let (parts, body) = response.into_parts();
|
||||
T::IncomingResponse::try_from_http_response(http::Response::from_parts(
|
||||
parts,
|
||||
body.as_ref(),
|
||||
))
|
||||
.map_err(|e| err!(BadServerResponse("Server returned bad 200 response: {e:?}")))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +248,7 @@ async fn into_http_response(
|
||||
url: &Url,
|
||||
mut response: Response,
|
||||
max_size: u64,
|
||||
) -> Result<http::Response<Bytes>> {
|
||||
) -> Result<http::Response<Vec<u8>>> {
|
||||
let status = response.status();
|
||||
trace!(
|
||||
%status, %method,
|
||||
@@ -267,20 +271,15 @@ async fn into_http_response(
|
||||
|
||||
trace!("Waiting for response body...");
|
||||
let http_response = http_response_builder
|
||||
.body(
|
||||
response
|
||||
.limit_read(max_size)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
.into(),
|
||||
)
|
||||
.body(response.limit_read(max_size).await.unwrap_or_default())
|
||||
.expect("reqwest body is valid http body");
|
||||
|
||||
debug!("Got {status:?} for {method} {url}");
|
||||
if !status.is_success() {
|
||||
let (parts, body) = http_response.into_parts();
|
||||
return Err(Error::Federation(
|
||||
dest.to_owned(),
|
||||
RumaError::from_http_response(http_response),
|
||||
RumaError::from_http_response(http::Response::from_parts(parts, body.as_ref())),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use ipaddress::IPAddress;
|
||||
use ruma::{
|
||||
DeviceId, OwnedDeviceId, RoomId, UInt, UserId,
|
||||
api::{
|
||||
IncomingResponse, OutgoingRequest, OutgoingRequestExt,
|
||||
IncomingResponseExt, OutgoingRequest, OutgoingRequestExt,
|
||||
auth_scheme::NoAuthentication,
|
||||
client::push::{Pusher, PusherKind, set_pusher},
|
||||
path_builder::SinglePath,
|
||||
@@ -266,10 +266,12 @@ impl Service {
|
||||
)));
|
||||
}
|
||||
|
||||
let (parts, body) = http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body")
|
||||
.into_parts();
|
||||
let response = T::IncomingResponse::try_from_http_response(
|
||||
http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body"),
|
||||
http::Response::from_parts(parts, body.as_ref()),
|
||||
);
|
||||
response.map_err(|e| {
|
||||
err!(BadServerResponse(warn!(
|
||||
|
||||
@@ -4,7 +4,7 @@ use bytes::BytesMut;
|
||||
use conduwuit::{Err, Result, debug_info, err, utils::response::LimitReadExt};
|
||||
use reqwest::Client;
|
||||
use ruma::api::{
|
||||
IncomingResponse, OutgoingRequest, OutgoingRequestExt,
|
||||
IncomingResponseExt, OutgoingRequest, OutgoingRequestExt,
|
||||
auth_scheme::{AppserviceToken, SendAccessToken},
|
||||
path_builder::VersionHistory,
|
||||
};
|
||||
@@ -76,11 +76,14 @@ where
|
||||
};
|
||||
}
|
||||
|
||||
let response = T::IncomingResponse::try_from_http_response(
|
||||
http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body"),
|
||||
);
|
||||
let (parts, body) = http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body")
|
||||
.into_parts();
|
||||
let response = T::IncomingResponse::try_from_http_response(http::Response::from_parts(
|
||||
parts,
|
||||
body.as_ref(),
|
||||
));
|
||||
|
||||
response.map_err(|e| {
|
||||
err!(BadServerResponse(warn!(
|
||||
|
||||
@@ -5,7 +5,7 @@ use conduwuit::{
|
||||
Err, Result, debug_error, err, trace, utils, utils::response::LimitReadExt, warn,
|
||||
};
|
||||
use ruma::api::{
|
||||
IncomingResponse, OutgoingRequest, OutgoingRequestExt,
|
||||
IncomingResponseExt, OutgoingRequest, OutgoingRequestExt,
|
||||
appservice::Registration,
|
||||
auth_scheme::{AccessToken, SendAccessToken},
|
||||
path_builder::SinglePath,
|
||||
@@ -97,11 +97,14 @@ impl super::Service {
|
||||
)));
|
||||
}
|
||||
|
||||
let response = T::IncomingResponse::try_from_http_response(
|
||||
http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body"),
|
||||
);
|
||||
let (parts, body) = http_response_builder
|
||||
.body(body)
|
||||
.expect("reqwest body is valid http body")
|
||||
.into_parts();
|
||||
let response = T::IncomingResponse::try_from_http_response(http::Response::from_parts(
|
||||
parts,
|
||||
body.as_ref(),
|
||||
));
|
||||
|
||||
response.map(Some).map_err(|e| {
|
||||
err!(BadServerResponse(warn!(
|
||||
|
||||
Reference in new issue
Block a user