Iterate over references instead of indexes for identities

This commit is contained in:
June 2023-08-20 17:15:45 -06:00 committed by GitHub
parent 855390ec43
commit 04969a0160
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,9 +103,9 @@ class APNSProxy:
# Replace public keys
for r in resp["results"].keys():
for i in range(len(resp["results"][r]["identities"])):
if "client-data" in resp["results"][r]["identities"][i]:
resp["results"][r]["identities"][i]["client-data"]["public-message-identity-key"] = b"REDACTED"
for identity in resp["results"][r]["identities"]:
if "client-data" in identity:
identity["client-data"]["public-message-identity-key"] = b"REDACTED"
resp = gzip.compress(plistlib.dumps(resp, fmt=plistlib.FMT_BINARY), mtime=0)
body["b"] = resp