main
Bob Mottram 2024-04-12 11:31:08 +01:00
parent 48f0830db9
commit f0ddf91a34
2 changed files with 29 additions and 20 deletions

View File

@ -1419,7 +1419,9 @@ def daemon_http_get(self) -> None:
self.server.domain, self.server.domain,
self.server.port, self.server.port,
self.server.followingItemsPerPage, self.server.followingItemsPerPage,
self.server.debug, 'following') self.server.debug, 'following',
self.server.onion_domain,
self.server.i2p_domain)
return return
if '/followers?page=' in self.path: if '/followers?page=' in self.path:
get_following_json(self, self.server.base_dir, get_following_json(self, self.server.base_dir,
@ -1429,7 +1431,9 @@ def daemon_http_get(self) -> None:
self.server.domain, self.server.domain,
self.server.port, self.server.port,
self.server.followingItemsPerPage, self.server.followingItemsPerPage,
self.server.debug, 'followers') self.server.debug, 'followers',
self.server.onion_domain,
self.server.i2p_domain)
return return
if '/followrequests?page=' in self.path: if '/followrequests?page=' in self.path:
get_following_json(self, self.server.base_dir, get_following_json(self, self.server.base_dir,
@ -1440,7 +1444,9 @@ def daemon_http_get(self) -> None:
self.server.port, self.server.port,
self.server.followingItemsPerPage, self.server.followingItemsPerPage,
self.server.debug, self.server.debug,
'followrequests') 'followrequests',
self.server.onion_domain,
self.server.i2p_domain)
return return
# authorized endpoint used for TTS of posts # authorized endpoint used for TTS of posts
@ -1570,7 +1576,9 @@ def daemon_http_get(self) -> None:
self.server.http_prefix, self.server.http_prefix,
nickname, self.server.domain, nickname, self.server.domain,
self.server.domain_full, self.server.domain_full,
self.server.system_language) self.server.system_language,
self.server.onion_domain,
self.server.i2p_domain)
return return
if not html_getreq and \ if not html_getreq and \
@ -1579,7 +1587,9 @@ def daemon_http_get(self) -> None:
self.path, self.path,
self.server.http_prefix, self.server.http_prefix,
self.server.domain_full, self.server.domain_full,
self.server.domain) self.server.domain,
self.server.onion_domain,
self.server.i2p_domain)
return return
fitness_performance(getreq_start_time, self.server.fitness, fitness_performance(getreq_start_time, self.server.fitness,

View File

@ -24,7 +24,9 @@ def get_featured_collection(self, calling_domain: str,
http_prefix: str, http_prefix: str,
nickname: str, domain: str, nickname: str, domain: str,
domain_full: str, domain_full: str,
system_language: str) -> None: system_language: str,
onion_domain: str,
i2p_domain: str) -> None:
"""Returns the featured posts collections in """Returns the featured posts collections in
actor/collections/featured actor/collections/featured
""" """
@ -33,12 +35,9 @@ def get_featured_collection(self, calling_domain: str,
nickname, domain, domain_full, system_language) nickname, domain, domain_full, system_language)
msg_str = json.dumps(featured_collection, msg_str = json.dumps(featured_collection,
ensure_ascii=False) ensure_ascii=False)
msg_str = convert_domains(calling_domain, msg_str = convert_domains(calling_domain, referer_domain,
referer_domain,
msg_str, http_prefix, msg_str, http_prefix,
domain, domain, onion_domain, i2p_domain)
self.server.onion_domain,
self.server.i2p_domain)
msg = msg_str.encode('utf-8') msg = msg_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
accept_str = self.headers['Accept'] accept_str = self.headers['Accept']
@ -51,10 +50,9 @@ def get_featured_collection(self, calling_domain: str,
def get_featured_tags_collection(self, calling_domain: str, def get_featured_tags_collection(self, calling_domain: str,
referer_domain: str, referer_domain: str,
path: str, path: str, http_prefix: str,
http_prefix: str, domain_full: str, domain: str,
domain_full: str, onion_domain: str, i2p_domain: str) -> None:
domain: str):
"""Returns the featured tags collections in """Returns the featured tags collections in
actor/collections/featuredTags actor/collections/featuredTags
""" """
@ -72,8 +70,8 @@ def get_featured_tags_collection(self, calling_domain: str,
referer_domain, referer_domain,
msg_str, http_prefix, msg_str, http_prefix,
domain, domain,
self.server.onion_domain, onion_domain,
self.server.i2p_domain) i2p_domain)
msg = msg_str.encode('utf-8') msg = msg_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
accept_str = self.headers['Accept'] accept_str = self.headers['Accept']
@ -89,7 +87,8 @@ def get_following_json(self, base_dir: str, path: str,
http_prefix: str, http_prefix: str,
domain: str, port: int, domain: str, port: int,
following_items_per_page: int, following_items_per_page: int,
debug: bool, list_name: str = 'following') -> None: debug: bool, list_name: str,
onion_domain: str, i2p_domain: str) -> None:
"""Returns json collection for following.txt """Returns json collection for following.txt
""" """
following_json = \ following_json = \
@ -106,8 +105,8 @@ def get_following_json(self, base_dir: str, path: str,
referer_domain, referer_domain,
msg_str, http_prefix, msg_str, http_prefix,
domain, domain,
self.server.onion_domain, onion_domain,
self.server.i2p_domain) i2p_domain)
msg = msg_str.encode('utf-8') msg = msg_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
accept_str = self.headers['Accept'] accept_str = self.headers['Accept']