kopia lustrzana https://github.com/snarfed/bridgy-fed
fix postprocess_as2() crash on multiply-valued inReplyTo
fixes https://console.cloud.google.com/errors/COTu_PXPjJ2ZWwpull/59/head
rodzic
fe96eeb5c3
commit
7c8a2a4603
|
@ -278,7 +278,7 @@ def postprocess_as2(activity, target=None, key=None):
|
|||
if len(in_reply_to) > 1:
|
||||
logging.warning(
|
||||
"AS2 doesn't support multiple inReplyTo URLs! "
|
||||
'Only using the first: %s' % in_reply_tos[0])
|
||||
'Only using the first: %s' % in_reply_to[0])
|
||||
activity['inReplyTo'] = in_reply_to[0]
|
||||
|
||||
# Mastodon evidently requires a Mention tag for replies to generate a
|
||||
|
|
|
@ -68,3 +68,11 @@ class CommonTest(testutil.TestCase):
|
|||
self.assertIsNone(common.redirect_wrap(None))
|
||||
self.assertEqual('', common.redirect_wrap(''))
|
||||
|
||||
def test_postprocess_as2_multiple_in_reply_tos(self):
|
||||
self.assertEqual({
|
||||
'id': 'http://localhost/r/xyz',
|
||||
'inReplyTo': 'foo',
|
||||
}, common.postprocess_as2({
|
||||
'id': 'xyz',
|
||||
'inReplyTo': ['foo', 'bar'],
|
||||
}))
|
||||
|
|
Ładowanie…
Reference in New Issue