Skip to content

Commit f9c603c

Browse files
authored
Merge pull request #120 from mautrix/pass-filename-upload-complete
Pass filename in query to upload complete endpoint
2 parents 98172d7 + 2322bf7 commit f9c603c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mautrix/client/api/modules/media_repository.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async def upload_media(
141141
path = MediaPath.unstable["fi.mau.msc2246"].upload[server_name][media_id].complete
142142

143143
if upload_url is not None:
144-
task = self._upload_to_url(upload_url, path, headers, data)
144+
task = self._upload_to_url(upload_url, path, headers, data, post_upload_query=query)
145145
else:
146146
task = self.api.request(
147147
method, path, content=data, headers=headers, query_params=query
@@ -285,6 +285,7 @@ async def _upload_to_url(
285285
post_upload_path: str,
286286
headers: dict[str, str],
287287
data: bytes | bytearray | AsyncIterable[bytes],
288+
post_upload_query: dict[str, str],
288289
) -> None:
289290
retry_count = self.api.default_retry_count
290291
backoff = 4
@@ -314,4 +315,4 @@ async def _upload_to_url(
314315
else:
315316
break
316317

317-
await self.api.request(Method.POST, post_upload_path)
318+
await self.api.request(Method.POST, post_upload_path, query_params=post_upload_query)

0 commit comments

Comments
 (0)