uploadRoomKeysToBackup: Use V3 route

Fixes https://github.com/element-hq/hydrogen-web/issues/741

"Tested" locally by rewriting `r0` to `v3` in reverse proxy (Caddy) and seeing `All keys are backed up.` instead of repeated failing PUT requests towards Conduit (home server)

```
matrix.example.com {
    rewrite /_matrix/client/r0/room_keys/keys /_matrix/client/v3/room_keys/keys?{query}
    reverse_proxy /_matrix/* localhost:8448
}
```
This commit is contained in:
Nicolai Søborg 2024-01-28 20:53:40 +01:00 committed by GitHub
parent 62332fe6a1
commit e924a76b4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -251,7 +251,8 @@ export class HomeServerApi {
return this._get(`/room_keys/keys/${encodeURIComponent(roomId)}/${encodeURIComponent(sessionId)}`, {version}, undefined, options);
}
uploadRoomKeysToBackup(version: string, payload: Record<string, any>, options?: BaseRequestOptions): IHomeServerRequest {
uploadRoomKeysToBackup(version: string, payload: Record<string, any>, options: BaseRequestOptions = {}): IHomeServerRequest {
options.prefix = CS_V3_PREFIX;
return this._put(`/room_keys/keys`, {version}, payload, options);
}