Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 9802de2

Browse files
committed
Fix getTurnServer response: integer ttl
`ttl` must be an integer according to the OpenAPI spec: https://github.com/matrix-org/matrix-doc/blob/old_master/data/api/client-server/voip.yaml#L70 True division (`/`) returns a float instead (`"ttl": 7200.0`). Floor division (`//`) returns an integer, so the response is spec compliant. Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
1 parent d138187 commit 9802de2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/10922.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki.

synapse/rest/client/voip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
7070
{
7171
"username": username,
7272
"password": password,
73-
"ttl": userLifetime / 1000,
73+
"ttl": userLifetime // 1000,
7474
"uris": turnUris,
7575
},
7676
)

0 commit comments

Comments
 (0)