diff --git a/gitea-to-ics.py b/gitea-to-ics.py index 414c8e3..a0e4df1 100644 --- a/gitea-to-ics.py +++ b/gitea-to-ics.py @@ -58,7 +58,11 @@ class Root: @cherrypy.expose def todo(self): authorization = cherrypy.request.headers.get('Authorization', ':') + if not authorization: + raise cherrypy.HTTPError(401, 'Unauthorized') token = get_token(authorization) + if not token: + raise cherrypy.HTTPError(401, 'Unauthorized') combined = get_combined(token) if not combined: raise cherrypy.HTTPError(401, 'Unauthorized')