Ensure etag is a string for GET room_keys/version response (#7691)
parent
b8ee03caff
commit
2b2344652b
|
@ -0,0 +1 @@
|
||||||
|
Fix a long standing bug where the response to the `GET room_keys/version` endpoint had the incorrect type for the `etag` field.
|
|
@ -349,6 +349,7 @@ class E2eRoomKeysHandler(object):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
res["count"] = yield self.store.count_e2e_room_keys(user_id, res["version"])
|
res["count"] = yield self.store.count_e2e_room_keys(user_id, res["version"])
|
||||||
|
res["etag"] = str(res["etag"])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@trace
|
@trace
|
||||||
|
|
|
@ -96,6 +96,7 @@ class E2eRoomKeysHandlerTestCase(unittest.TestCase):
|
||||||
# check we can retrieve it as the current version
|
# check we can retrieve it as the current version
|
||||||
res = yield self.handler.get_version_info(self.local_user)
|
res = yield self.handler.get_version_info(self.local_user)
|
||||||
version_etag = res["etag"]
|
version_etag = res["etag"]
|
||||||
|
self.assertIsInstance(version_etag, str)
|
||||||
del res["etag"]
|
del res["etag"]
|
||||||
self.assertDictEqual(
|
self.assertDictEqual(
|
||||||
res,
|
res,
|
||||||
|
|
Loading…
Reference in New Issue