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 # Replace public keys
for r in resp["results"].keys(): for r in resp["results"].keys():
for i in range(len(resp["results"][r]["identities"])): for identity in resp["results"][r]["identities"]:
if "client-data" in resp["results"][r]["identities"][i]: if "client-data" in identity:
resp["results"][r]["identities"][i]["client-data"]["public-message-identity-key"] = b"REDACTED" identity["client-data"]["public-message-identity-key"] = b"REDACTED"
resp = gzip.compress(plistlib.dumps(resp, fmt=plistlib.FMT_BINARY), mtime=0) resp = gzip.compress(plistlib.dumps(resp, fmt=plistlib.FMT_BINARY), mtime=0)
body["b"] = resp body["b"] = resp