Fix auto-selection of digest auth not working

This commit is contained in:
Kovid Goyal 2017-04-13 10:56:50 +05:30
parent 0fab2c603e
commit 0ae992a841
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -127,7 +127,7 @@ class Handler(object):
self.auth_controller = None self.auth_controller = None
if opts.auth: if opts.auth:
has_ssl = opts.ssl_certfile is not None and opts.ssl_keyfile is not None has_ssl = opts.ssl_certfile is not None and opts.ssl_keyfile is not None
prefer_basic_auth = {'auto':has_ssl, 'basic':True}.get(opts.auth_mode, 'digest') prefer_basic_auth = {'auto':has_ssl, 'basic':True}.get(opts.auth_mode, False)
self.auth_controller = AuthController(user_credentials=ctx.user_manager, prefer_basic_auth=prefer_basic_auth) self.auth_controller = AuthController(user_credentials=ctx.user_manager, prefer_basic_auth=prefer_basic_auth)
self.router = Router(ctx=ctx, url_prefix=opts.url_prefix, auth_controller=self.auth_controller) self.router = Router(ctx=ctx, url_prefix=opts.url_prefix, auth_controller=self.auth_controller)
for module in ('content', 'ajax', 'code', 'legacy', 'opds', 'books'): for module in ('content', 'ajax', 'code', 'legacy', 'opds', 'books'):