Bob Mottram 2023-01-18 14:05:58 +00:00
commit e5018e61c4
9 changed files with 26 additions and 22 deletions

View File

@ -12285,7 +12285,6 @@ class PubServer(BaseHTTPRequestHandler):
msglen, calling_domain)
self._write(msg)
self.server.getreq_busy = False
self._redirect_headers(post_id, None, calling_domain)
return True
def _show_individual_at_post(self, ssml_getreq: bool, authorized: bool,
@ -15768,11 +15767,11 @@ class PubServer(BaseHTTPRequestHandler):
# for news instances if not logged in then show the
# front page
divert_path = '/users/news'
# if debug:
print('DEBUG: divert_to_login_screen=' +
str(divert_to_login_screen))
print('DEBUG: authorized=' + str(authorized))
print('DEBUG: path=' + path)
if debug:
print('DEBUG: divert_to_login_screen=' +
str(divert_to_login_screen))
print('DEBUG: authorized=' + str(authorized))
print('DEBUG: path=' + path)
if calling_domain.endswith('.onion') and onion_domain:
self._redirect_headers('http://' +
onion_domain + divert_path,

Binary file not shown.

Binary file not shown.

View File

@ -117,7 +117,13 @@ def sign_post_headers(date_str: str, private_key_pem: str,
# strip the trailing linefeed
signed_header_text = signed_header_text.rstrip('\n')
# signed_header_text.encode('ascii') matches
header_digest = get_sha_256(signed_header_text.encode('ascii'))
try:
sig_header_encoded = signed_header_text.encode('ascii')
except UnicodeEncodeError:
sig_header_encoded = signed_header_text
print('WARN: sign_post_headers unable to ascii encode ' +
signed_header_text)
header_digest = get_sha_256(sig_header_encoded)
# print('header_digest2: ' + str(header_digest))
# Sign the digest

View File

@ -337,16 +337,17 @@ def parse_feed_date(pub_date: str, unique_string_identifier: str) -> str:
continue
# remove any fraction of a second
if '.' in pub_date:
ending = pub_date.split('.')[1]
pub_date2 = pub_date
if '.' in pub_date2:
ending = pub_date2.split('.')[1]
timezone_str = ''
for ending_char in ending:
if not ending_char.isdigit():
timezone_str += ending_char
if timezone_str:
pub_date = pub_date.split('.')[0] + timezone_str
if '+' in ending:
timezone_str = '+' + ending.split('+')[1]
elif '-' in ending:
timezone_str = '-' + ending.split('-')[1]
pub_date2 = pub_date2.split('.')[0] + timezone_str
try:
published_date = datetime.strptime(pub_date, date_format)
published_date = datetime.strptime(pub_date2, date_format)
except BaseException:
continue

View File

@ -1,5 +1,5 @@
#!/bin/bash
journalctl -u epicyon | grep 'get_json Forbidden ' > .blocked_events.txt
journalctl -u epicyon | grep -i 'get_json forbidden \|blocked' > .blocked_events.txt
if [ ! -f .blocked_events.txt ]; then
echo 'No blocking events'
else

View File

@ -63,7 +63,7 @@ def html_conversation_view(post_id: str,
html_header_with_external_style(css_filename, instance_title, None)
separator_str = html_post_separator(base_dir, None)
text_mode_separator = '<div class="transparent"><hr></div>'
text_mode_separator = '<div class="transparent"><hr></div>\n'
minimize_all_images = False
if nickname in min_images_for_accounts:
@ -99,9 +99,7 @@ def html_conversation_view(post_id: str,
minimize_all_images, None,
buy_sites)
if post_str:
# check for "HTTP/1.1 303 See Other Server"
if 'X-AP-Instance-ID' not in post_str:
conv_str += text_mode_separator + separator_str + post_str
conv_str += text_mode_separator + separator_str + post_str
conv_str += text_mode_separator + html_footer()
return conv_str

View File

@ -775,7 +775,7 @@ def html_new_post(edit_post_params: {},
' <label class="labels">' + \
translate['Language used'] + '</label>\n'
replies_section += languages_dropdown
buy_link_str = '🛒 ' + translate['Buy link']
buy_link_str = translate['Buy link']
replies_section += edit_text_field(buy_link_str, 'buyUrl',
default_buy_site, 'https://...')
replies_section += '</div>\n'

View File

@ -1082,7 +1082,7 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int,
debug: bool, buy_sites: {}) -> str:
"""Show a page containing search results for a remote hashtag
"""
hashtag = hashtag_url.split('/')[-1]
hashtag = urllib.parse.unquote(hashtag_url.split('/')[-1])
profile_str = 'https://www.w3.org/ns/activitystreams'
as_header = {