From d91836828490fff047b65c278a6a05af57c3a21c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 15 Feb 2022 15:26:09 +0000 Subject: [PATCH] Tidying --- daemon.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index ff695f895..730f7a0a0 100644 --- a/daemon.py +++ b/daemon.py @@ -1189,11 +1189,14 @@ class PubServer(BaseHTTPRequestHandler): def _show_vcard(self, base_dir: str, path: str, calling_domain: str, referer_domain: str, domain: str, debug: bool) -> bool: + """Returns a vcard for the given account + """ if not self._has_accept(calling_domain): return False - if 'text/vcard' not in self.headers['Accept']: + accept_str = self.headers['Accept'] + if 'text/vcard' not in accept_str: return False - if 'application/' in self.headers['Accept']: + if 'application/' in accept_str: return False if not path.startswith('/users/'): self._400()