mirror of https://gitlab.com/bashrc2/epicyon
Application mime type
parent
0b7072e576
commit
5b7cc67720
|
@ -1199,9 +1199,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
accept_str = 'text/vcard'
|
accept_str = 'text/vcard'
|
||||||
else:
|
else:
|
||||||
accept_str = self.headers['Accept']
|
accept_str = self.headers['Accept']
|
||||||
if 'text/vcard' not in accept_str:
|
if 'text/vcard' not in accept_str and \
|
||||||
return False
|
'application/vcard+xml' not in accept_str:
|
||||||
if 'application/' in accept_str:
|
|
||||||
return False
|
return False
|
||||||
if path.startswith('/@'):
|
if path.startswith('/@'):
|
||||||
path = path.replace('/@', '/users/', 1)
|
path = path.replace('/@', '/users/', 1)
|
||||||
|
@ -1228,9 +1227,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._404()
|
self._404()
|
||||||
self.server.vcard_is_active = False
|
self.server.vcard_is_active = False
|
||||||
return True
|
return True
|
||||||
if 'vcard+xml' in accept_str:
|
if 'application/vcard+xml' in accept_str:
|
||||||
vcard_str = actor_to_vcard_xml(actor_json, domain)
|
vcard_str = actor_to_vcard_xml(actor_json, domain)
|
||||||
header_type = 'text/vcard+xml; charset=utf-8'
|
header_type = 'application/vcard+xml; charset=utf-8'
|
||||||
else:
|
else:
|
||||||
vcard_str = actor_to_vcard(actor_json, domain)
|
vcard_str = actor_to_vcard(actor_json, domain)
|
||||||
header_type = 'text/vcard; charset=utf-8'
|
header_type = 'text/vcard; charset=utf-8'
|
||||||
|
|
|
@ -260,7 +260,7 @@ def get_vcard(xml_format: bool,
|
||||||
'Accept': 'text/vcard'
|
'Accept': 'text/vcard'
|
||||||
}
|
}
|
||||||
if xml_format:
|
if xml_format:
|
||||||
headers['Accept'] = 'text/vcard+xml'
|
headers['Accept'] = 'application/vcard+xml'
|
||||||
session_params = {}
|
session_params = {}
|
||||||
session_headers = {}
|
session_headers = {}
|
||||||
if headers:
|
if headers:
|
||||||
|
|
Loading…
Reference in New Issue