mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-24 17:00:26 -04:00
Fix /key/v2/server calls with URL-unsafe key IDs (#14490)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
78e23eea05
commit
e1b15f25f3
3 changed files with 14 additions and 1 deletions
|
@ -469,6 +469,18 @@ class ServerKeyFetcherTestCase(unittest.HomeserverTestCase):
|
|||
keys = self.get_success(fetcher.get_keys(SERVER_NAME, ["key1"], 0))
|
||||
self.assertEqual(keys, {})
|
||||
|
||||
def test_keyid_containing_forward_slash(self) -> None:
|
||||
"""We should url-encode any url unsafe chars in key ids.
|
||||
|
||||
Detects https://github.com/matrix-org/synapse/issues/14488.
|
||||
"""
|
||||
fetcher = ServerKeyFetcher(self.hs)
|
||||
self.get_success(fetcher.get_keys("example.com", ["key/potato"], 0))
|
||||
|
||||
self.http_client.get_json.assert_called_once()
|
||||
args, kwargs = self.http_client.get_json.call_args
|
||||
self.assertEqual(kwargs["path"], "/_matrix/key/v2/server/key%2Fpotato")
|
||||
|
||||
|
||||
class PerspectivesKeyFetcherTestCase(unittest.HomeserverTestCase):
|
||||
def make_homeserver(self, reactor, clock):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue