Skip to content

Commit

Permalink
uploadRoomKeysToBackup: Use V3 route
Browse files Browse the repository at this point in the history
Fixes #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
}
```

Signed-off-by: Nicolai Søborg <git@xn--sb-lka.org>
  • Loading branch information
NicolaiSoeborg committed Aug 20, 2024
1 parent 62332fe commit 45d5fd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/matrix/net/HomeServerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 45d5fd5

Please sign in to comment.