From f620eb02799be7aa376ed408fe6cbcee98e796bc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Jun 2015 10:21:50 +0530 Subject: [PATCH] Make the default endpoint require authentication --- src/calibre/srv/routes.py | 2 +- src/calibre/srv/tests/auth.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/srv/routes.py b/src/calibre/srv/routes.py index 6fd13021c3..4a0dc3bf73 100644 --- a/src/calibre/srv/routes.py +++ b/src/calibre/srv/routes.py @@ -17,7 +17,7 @@ default_methods = frozenset(('HEAD', 'GET')) def route_key(route): return route.partition('{')[0].rstrip('/') -def endpoint(route, methods=default_methods, types=None, auth_required=False, android_workaround=False): +def endpoint(route, methods=default_methods, types=None, auth_required=True, android_workaround=False): def annotate(f): f.route = route.rstrip('/') or '/' f.types = types or {} diff --git a/src/calibre/srv/tests/auth.py b/src/calibre/srv/tests/auth.py index f309b04172..1147d592e2 100644 --- a/src/calibre/srv/tests/auth.py +++ b/src/calibre/srv/tests/auth.py @@ -14,7 +14,7 @@ from calibre.srv.routes import endpoint, Router REALM = 'calibre-test' -@endpoint('/open') +@endpoint('/open', auth_required=False) def noauth(ctx, data): return 'open'