mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Use correct token handlers for Ruma
This commit is contained in:
@@ -3,7 +3,7 @@ use std::{fmt::Debug, mem};
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, debug_error, debug_warn, err,
|
Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, debug_error, debug_warn, err,
|
||||||
error::inspect_debug_log, implement, trace, utils::string::EMPTY,
|
error::inspect_debug_log, implement, trace,
|
||||||
};
|
};
|
||||||
use http::{HeaderValue, header::AUTHORIZATION};
|
use http::{HeaderValue, header::AUTHORIZATION};
|
||||||
use ipaddress::IPAddress;
|
use ipaddress::IPAddress;
|
||||||
@@ -289,10 +289,13 @@ where
|
|||||||
T: OutgoingRequest + Send,
|
T: OutgoingRequest + Send,
|
||||||
{
|
{
|
||||||
const VERSIONS: [MatrixVersion; 1] = [MatrixVersion::V1_11];
|
const VERSIONS: [MatrixVersion; 1] = [MatrixVersion::V1_11];
|
||||||
const SATIR: SendAccessToken<'_> = SendAccessToken::IfRequired(EMPTY);
|
|
||||||
|
|
||||||
let http_request = request
|
let http_request = request
|
||||||
.try_into_http_request::<Vec<u8>>(actual.string().as_str(), SATIR, &VERSIONS)
|
.try_into_http_request::<Vec<u8>>(
|
||||||
|
actual.string().as_str(),
|
||||||
|
SendAccessToken::None,
|
||||||
|
&VERSIONS,
|
||||||
|
)
|
||||||
.map_err(|e| err!(BadServerResponse("Invalid destination: {e:?}")))?;
|
.map_err(|e| err!(BadServerResponse("Invalid destination: {e:?}")))?;
|
||||||
|
|
||||||
Ok(http_request)
|
Ok(http_request)
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ impl Service {
|
|||||||
trace!("Push gateway destination: {dest}");
|
trace!("Push gateway destination: {dest}");
|
||||||
|
|
||||||
let http_request = request
|
let http_request = request
|
||||||
.try_into_http_request::<BytesMut>(&dest, SendAccessToken::IfRequired(""), &VERSIONS)
|
.try_into_http_request::<BytesMut>(&dest, SendAccessToken::None, &VERSIONS)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
err!(BadServerResponse(warn!(
|
err!(BadServerResponse(warn!(
|
||||||
"Failed to find destination {dest} for push gateway: {e}"
|
"Failed to find destination {dest} for push gateway: {e}"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ where
|
|||||||
let mut http_request = request
|
let mut http_request = request
|
||||||
.try_into_http_request::<BytesMut>(
|
.try_into_http_request::<BytesMut>(
|
||||||
&dest,
|
&dest,
|
||||||
SendAccessToken::IfRequired(hs_token),
|
SendAccessToken::Appservice(hs_token),
|
||||||
&VERSIONS,
|
&VERSIONS,
|
||||||
)
|
)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
|
|||||||
Reference in New Issue
Block a user