Gracefully handle ill-formed remote images in rich text

A better fix has been proposed upstream at
https://github.com/rails/rails/pull/56283 but this should be fine in
the meantime.

ref: https://app.fizzy.do/5986089/cards/3188
This commit is contained in:
Mike Dalessio
2025-12-03 11:24:39 -05:00
parent 069e0ca0b2
commit 89940d36f8
3 changed files with 13 additions and 2 deletions
+11
View File
@@ -121,4 +121,15 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to boards(:writebook)
end
test "show card with comment containing malformed remote image attachment" do
card = cards(:logo)
card.comments.create!(
creator: users(:kevin),
body: '<action-text-attachment url="image.png" content-type="image/*" presentation="gallery"></action-text-attachment>'
)
get card_path(card)
assert_response :success
end
end