Ryan Barrett 2025-01-30 10:50:55 -08:00
rodzic a077e74f86
commit e5337b5029
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -1124,6 +1124,9 @@ def poll_chat_task():
def hashtag_redirect(hashtag):
if (util.domain_from_link(request.host_url) ==
f'{ATProto.ABBREV}{common.SUPERDOMAIN}'):
return redirect(f'https://bsky.app/search?q=%23{hashtag}')
try:
return redirect(f'https://bsky.app/search?q=%23{hashtag}')
except ValueError as e:
logging.warning(e)
raise NotFound()

Wyświetl plik

@ -2788,3 +2788,8 @@ Sed tortor neque, aliquet quis posuere aliquam […]
resp = self.get('/hashtag/foo', base_url='https://web.brid.gy')
self.assert_equals(404, resp.status_code)
def test_hashtag_with_newlines_error(self):
# https://console.cloud.google.com/errors/detail/COugjNSr9oCtfg;time=PT1H;locations=global?project=bridgy-federated
resp = self.get('/hashtag/x%0Ay', base_url='https://bsky.brid.gy')
self.assert_equals(404, resp.status_code)