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

Commit

Permalink
Fix getTurnServer response: integer ttl
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
lukaslihotzki committed Sep 27, 2021
1 parent d138187 commit 9802de2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10922.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki.
2 changes: 1 addition & 1 deletion synapse/rest/client/voip.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
{
"username": username,
"password": password,
"ttl": userLifetime / 1000,
"ttl": userLifetime // 1000,
"uris": turnUris,
},
)
Expand Down

0 comments on commit 9802de2

Please sign in to comment.