diff --git a/daemon.py b/daemon.py index 7d6a956d4..a8dfa0cac 100644 --- a/daemon.py +++ b/daemon.py @@ -12225,7 +12225,8 @@ class PubServer(BaseHTTPRequestHandler): calling_domain: str, path: str, base_dir: str, http_prefix: str, domain: str, port: int, - debug: str, curr_session) -> bool: + debug: str, curr_session, + cookie: str) -> bool: """get conversation thread from the date link on a post """ if not authorized: @@ -12284,9 +12285,15 @@ class PubServer(BaseHTTPRequestHandler): if conv_str: msg = conv_str.encode('utf-8') msglen = len(msg) - self._login_headers('text/html', - msglen, calling_domain) + self._login_headers('text/html', msglen, calling_domain) self._write(msg) + self.server.getreq_busy = False + return True + # redirect to the original site if there are no results + if '://' + self.server.domain_full + '/' in post_id: + self._redirect_headers(post_id, cookie, calling_domain) + else: + self._redirect_headers(post_id, None, calling_domain) self.server.getreq_busy = False return True @@ -16964,7 +16971,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.domain, self.server.port, self.server.debug, - self.server.session): + self.server.session, + cookie): fitness_performance(getreq_start_time, self.server.fitness, '_GET', '_show_conversation_thread', self.server.debug) diff --git a/tests.py b/tests.py index 40b2ef2c8..625df2196 100644 --- a/tests.py +++ b/tests.py @@ -54,6 +54,7 @@ from follow import clear_followers from follow import send_follow_request_via_server from follow import send_unfollow_request_via_server from siteactive import site_is_active +from utils import html_tag_has_closing from utils import remove_inverted_text from utils import remove_square_capitals from utils import standardize_text @@ -7777,6 +7778,22 @@ def _test_replace_remote_tags() -> None: assert result == expected +def _test_html_closing_tag() -> None: + print('html_closing_tag') + content = '
@ooh@wibbly.wobbly.worldLike, ' + \
+ 'OMG!
Something with some-widget
' + \
+ 'and something else ' + \
+ 'totally' + \
+ ' on the razzle.
As for it ' + \
+ 'WHATEVER' + \
+ ' archaeopteryx.
Some code
line too long')
return False
ctr += 1
return True
@@ -1166,7 +1168,7 @@ def dangerous_markup(content: str, allow_local_network_access: bool) -> bool:
if _is_dangerous_string_simple(content, allow_local_network_access,
separators, invalid_strings):
return True
- if not _html_tag_has_closing('code', content):
+ if not html_tag_has_closing('code', content):
return True
invalid_strings = [
'script', 'noscript', 'pre',