From 2303bfa9512b0d9227e2b105bc6a1d838990013a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Nov 2008 12:10:44 -0800 Subject: [PATCH] Fix #1294 (Content Server doesn't asks for username and password when accessed) --- src/calibre/library/server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 9a7d30244b..febeffa7f7 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -132,10 +132,11 @@ class LibraryServer(object): 'tools.gzip.mime_types': ['text/html', 'text/plain', 'text/xml', 'text/javascript', 'text/css'], }} if opts.password: - g = self.config['global'] - g['tools.digest_auth.on'] = True - g['tools.digest_auth.realm'] = _('Password to access your calibre library. Username is ') + opts.username.strip() - g['tools.digest_auth.users'] = {opts.username.strip():opts.password.strip()} + self.config['/'] = { + 'tools.digest_auth.on' : True, + 'tools.digest_auth.realm' : _('Password to access your calibre library. Username is ') + opts.username.strip(), + 'tools.digest_auth.users' : {opts.username.strip():opts.password.strip()}, + } self.is_running = False self.exception = None