minor change

This commit is contained in:
JJTech0130 2023-04-11 12:24:38 -04:00
parent b128ac514a
commit 8148504722
No known key found for this signature in database
GPG key ID: 23C92EBCCF8F93D6

10
ids.py
View file

@ -91,8 +91,6 @@ def _send_request(conn: apns.APNSConnection, type: str, body: bytes) -> bytes:
# Sign the request
signature, nonce = sign_payload(global_key, type, "", PUSH_TOKEN, body)
print(signature)
headers = {
"x-id-cert": global_cert.replace("-----BEGIN CERTIFICATE-----", "")
.replace("-----END CERTIFICATE-----", "")
@ -119,12 +117,12 @@ def _send_request(conn: apns.APNSConnection, type: str, body: bytes) -> bytes:
conn.send_message("com.apple.madrid", plistlib.dumps(req, fmt=plistlib.FMT_BINARY))
resp = conn.wait_for_packet(0x0A)
resp2 = apns._get_field(resp[1], 3)
resp_body = apns._get_field(resp[1], 3)
if resp2 is None:
print(f"Got invalid response: {resp}")
if resp_body is None:
raise (Exception(f"Got invalid response: {resp}"))
return resp2
return resp_body
def lookup(conn: apns.APNSConnection, query: list[str]) -> any: