fix: Stop forcing the appservice token into the URL

This commit is contained in:
Jade Ellis 2026-01-05 18:14:16 +00:00
parent 7ec81c25f1
commit f2e588b294
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -32,7 +32,7 @@ where
trace!("Appservice URL \"{dest}\", Appservice ID: {}", registration.id);
let hs_token = registration.hs_token.as_str();
let mut http_request = request
let http_request = request
.try_into_http_request::<BytesMut>(
&dest,
SendAccessToken::Appservice(hs_token),
@ -45,17 +45,6 @@ where
})?
.map(BytesMut::freeze);
let mut parts = http_request.uri().clone().into_parts();
let old_path_and_query = parts.path_and_query.unwrap().as_str().to_owned();
let symbol = if old_path_and_query.contains('?') { "&" } else { "?" };
parts.path_and_query = Some(
(old_path_and_query + symbol + "access_token=" + hs_token)
.parse()
.unwrap(),
);
*http_request.uri_mut() = parts.try_into().expect("our manipulation is always valid");
let reqwest_request = reqwest::Request::try_from(http_request)?;
let client = &self.services.client.appservice;