From 0eb87a27313d0619678f5b095bfb10f14cd9ef2e Mon Sep 17 00:00:00 2001 From: Waldek Date: Wed, 11 Dec 2019 15:10:48 +0100 Subject: [PATCH] Update monitor-test.py --- monitor-test.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/monitor-test.py b/monitor-test.py index 558e0db..ee88e99 100644 --- a/monitor-test.py +++ b/monitor-test.py @@ -721,24 +721,7 @@ class web_server(Resource): isLeaf = True def render_GET(self, request): logging.info('static website requested: %s', request) - if WEB_AUTH: - user = WEB_USER.encode('utf-8') - password = WEB_PASS.encode('utf-8') - auth = request.getHeader('Authorization') - if auth and auth.split(' ')[0] == 'Basic': - decodeddata = base64.b64decode(auth.split(' ')[1]) - if decodeddata.split(b':') == [user, password]: - return (index_html).encode('utf-8') - request.setResponseCode(401) - request.setHeader('WWW-Authenticate', 'Basic realm="realmname"') - return " \ -


\ -
\ -

Wymagana autoryzacja

".encode('utf-8') - else: - return (index_html).encode('utf-8') + return (index_html).encode('utf-8') if __name__ == '__main__': logging.basicConfig(