From 21ab522cefee5a7d623c122b4ddc9052b7a5c93c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 20 Feb 2023 10:19:09 +0000 Subject: [PATCH] If remote hashtags are not found the redirect to the original url --- daemon.py | 4 +++- webapp_search.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 1bd5095f3..9fd7231fb 100644 --- a/daemon.py +++ b/daemon.py @@ -18940,7 +18940,9 @@ class PubServer(BaseHTTPRequestHandler): self._write(msg) self.server.getreq_busy = False return - self._404() + else: + # redirect to the hashtag url + self._redirect_headers(hashtag_url, None, calling_domain) self.server.getreq_busy = False return diff --git a/webapp_search.py b/webapp_search.py index e95262563..852dd7eb2 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -1103,6 +1103,8 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int, print('No orderedItems in hashtag collection ' + str(hashtag_json)) else: print('WARN: no hashtags returned for url ' + hashtag_url) + if not lines: + return '' separator_str = html_post_separator(base_dir, None)