Skip to content

Commit

Permalink
Introduce SETMAGICCOOKIE endpoint. First appeared during iOS17 betas.
Browse files Browse the repository at this point in the history
Strange that newer UACs send this request to older SDK endpoints that
do not support this.

This functionality may make playback more complex in the future.

Tested on iOS 17.0.2 - works fine for playback.
  • Loading branch information
systemcrash committed Oct 2, 2023
1 parent 224b966 commit 6c343d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ap2-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def do_OPTIONS(self):
"ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH"
"FLUSHBUFFERED, TEARDOWN, OPTIONS, POST, GET, PUT"
"SETPEERSX"
"SETMAGICCOOKIE"
)
self.end_headers()

Expand Down Expand Up @@ -866,6 +867,21 @@ def do_FLUSH(self):
self.send_header("CSeq", self.headers["CSeq"])
self.end_headers()

def do_SETMAGICCOOKIE(self):
# First appeared in iOS 17 betas ( User-Agent: AirPlay/710.66.3 )
self.logger.info(f'{self.command}: {self.path}')
self.logger.debug(self.headers)
content_len = int(self.headers["Content-Length"])
if content_len > 0:
body = self.rfile.read(content_len)

plist = readPlistFromString(body)
self.logger.info(self.pp.pformat(plist))
self.send_response(200)
self.send_header("Server", self.version_string())
self.send_header("CSeq", self.headers["CSeq"])
self.end_headers()

def handle_command(self):
if self.headers["Content-Type"] == HTTP_CT_BPLIST:
content_len = int(self.headers["Content-Length"])
Expand Down

0 comments on commit 6c343d3

Please sign in to comment.