From 6c1543c05b79ae8bef2d2f7d703002a432776baf Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Tue, 25 Aug 2015 17:50:22 -0400 Subject: [PATCH] Fix auth plugins on Python 3.x Python 3 does not have a `getheader` method on the header object, and instead uses just `get`. --- websockify/auth_plugins.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/websockify/auth_plugins.py b/websockify/auth_plugins.py index dd1b8de..647c26e 100644 --- a/websockify/auth_plugins.py +++ b/websockify/auth_plugins.py @@ -19,7 +19,6 @@ class InvalidOriginError(AuthenticationError): "Invalid Origin Header: Expected one of " "%s, got '%s'" % (expected, actual)) - class ExpectOrigin(object): def __init__(self, src=None): if src is None: @@ -28,6 +27,6 @@ class ExpectOrigin(object): self.source = src.split() def authenticate(self, headers, target_host, target_port): - origin = headers.getheader('Origin', None) + origin = headers.get('Origin', None) if origin is None or origin not in self.source: raise InvalidOriginError(expected=self.source, actual=origin)