From 4213d7dc278f1cd1b94fd1e079825be9cf23c161 Mon Sep 17 00:00:00 2001 From: Ben Muthalaly Date: Sat, 26 Oct 2024 01:53:49 -0500 Subject: [PATCH] Fix API crash --- archivebox/api/v1_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/api/v1_api.py b/archivebox/api/v1_api.py index 7076f5d1..b989bc92 100644 --- a/archivebox/api/v1_api.py +++ b/archivebox/api/v1_api.py @@ -64,7 +64,7 @@ class NinjaAPIWithIOCapture(NinjaAPI): # Add Auth Headers to response api_token = getattr(request, '_api_token', None) - token_expiry = api_token.expires.isoformat() if api_token else 'Never' + token_expiry = api_token.expires.isoformat() if api_token and api_token.expires else 'Never' response['X-ArchiveBox-Auth-Method'] = getattr(request, '_api_auth_method', None) or 'None' response['X-ArchiveBox-Auth-Expires'] = token_expiry