From aa14e8259fda0cbb28bb61a404bfb941dfea0cca Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 18 Oct 2021 16:08:09 +0200 Subject: [PATCH] Fix Plex Web's Plex Companion connection terminating suddenly --- resources/lib/plexbmchelper/listener.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/lib/plexbmchelper/listener.py b/resources/lib/plexbmchelper/listener.py index 1b6ce3a3..6473bfed 100644 --- a/resources/lib/plexbmchelper/listener.py +++ b/resources/lib/plexbmchelper/listener.py @@ -181,9 +181,9 @@ class MyHandler(BaseHTTPRequestHandler): 'Content-Type': 'text/xml;charset=utf-8' }.update(headers)) else: - # Fail connection with HTTP 500 error - has been open too long + # We're not playing anything yet, just reply with a 200 self.response( - 'Need to close this connection on the PKC side', + msg, { 'X-Plex-Client-Identifier': v.PKC_MACHINE_IDENTIFIER, 'X-Plex-Protocol': '1.0', @@ -192,8 +192,7 @@ class MyHandler(BaseHTTPRequestHandler): 'Access-Control-Expose-Headers': 'X-Plex-Client-Identifier', 'Content-Type': 'text/xml;charset=utf-8' - }.update(headers), - code=500) + }.update(headers)) elif "/subscribe" in request_path: headers['Content-Type'] = 'text/xml;charset=utf-8' headers = clientinfo.getXArgsDeviceInfo(options=headers,