We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99a9dc4 commit 45ff229Copy full SHA for 45ff229
mstickerlib/src/matrix/mod.rs
@@ -196,9 +196,10 @@ where
196
.unwrap_or_else(|| path.as_os_str())
197
.to_str()
198
.expect("Not valid UTF-8");
199
+ let slash = if matrix.homeserver_url.ends_with('/') { "" } else { "/" };
200
let answer = CLIENT
201
.get()
- .post(&format!("{}/_matrix/media/v3/upload", matrix.homeserver_url))
202
+ .post(&format!("{}{slash}_matrix/media/v3/upload", matrix.homeserver_url))
203
.query(&[("access_token", matrix.access_token.as_str()), ("filename", filename)])
204
.header("Content-Type", mimetype)
205
.body(data.to_owned()) //TODO check for better solution
0 commit comments