diff --git a/src/calibre/srv/auth.py b/src/calibre/srv/auth.py index 2aecca45e3..c43348782c 100644 --- a/src/calibre/srv/auth.py +++ b/src/calibre/srv/auth.py @@ -11,7 +11,7 @@ from hashlib import md5, sha256 from itertools import permutations from threading import Lock -from calibre.srv.errors import HTTPAuthRequired, HTTPSimpleResponse, InvalidCredentials +from calibre.srv.errors import HTTPAuthRequired, HTTPSimpleResponse from calibre.srv.http_request import parse_uri from calibre.srv.utils import parse_http_dict, encode_path from calibre.utils.monotonic import monotonic @@ -196,13 +196,6 @@ class AuthController(object): self.realm = realm if '"' in realm: raise ValueError('Double-quotes are not allowed in the authentication realm') - for k, v in self.user_credentials.iteritems(): - if '"' in k: - raise ValueError('Double-quotes are not allowed in usernames') - try: - k.encode('ascii'), v.encode('ascii') - except ValueError: - raise InvalidCredentials('Only ASCII characters are allowed in usernames and passwords') def check(self, un, pw): return pw and self.user_credentials.get(un) == pw diff --git a/src/calibre/srv/errors.py b/src/calibre/srv/errors.py index 42295f7c94..c53480fab2 100644 --- a/src/calibre/srv/errors.py +++ b/src/calibre/srv/errors.py @@ -43,6 +43,3 @@ class HTTPBadRequest(HTTPSimpleResponse): def __init__(self, message, close_connection=False): HTTPSimpleResponse.__init__(self, httplib.BAD_REQUEST, message, close_connection) - -class InvalidCredentials(ValueError): - pass diff --git a/src/calibre/srv/standalone.py b/src/calibre/srv/standalone.py index 9694108bdf..4741066f8f 100644 --- a/src/calibre/srv/standalone.py +++ b/src/calibre/srv/standalone.py @@ -10,7 +10,6 @@ import sys, os, signal from calibre import as_unicode, prints from calibre.constants import plugins, iswindows, preferred_encoding -from calibre.srv.errors import InvalidCredentials from calibre.srv.loop import ServerLoop from calibre.srv.bonjour import BonJour from calibre.srv.opts import opts_to_parser @@ -227,10 +226,7 @@ def main(args=sys.argv): except NoAutoReload as e: raise SystemExit(e.message) opts.auto_reload_port=int(os.environ.get('CALIBRE_AUTORELOAD_PORT', 0)) - try: - server=Server(libraries, opts) - except InvalidCredentials as e: - raise SystemExit(e.message) + server=Server(libraries, opts) if opts.daemonize: if not opts.log and not iswindows: raise SystemExit('In order to daemonize you must specify a log file, you can use /dev/stdout to log to screen even as a daemon')