kopia lustrzana https://github.com/snarfed/bridgy-fed
atproto: /hashtag bug fix, handle newlines
fixes https://console.cloud.google.com/errors/detail/COugjNSr9oCtfg;time=PT1H;locations=global?project=bridgy-federatedpull/1743/head
rodzic
a077e74f86
commit
e5337b5029
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue