Handle invalid custom emoji URLs

This commit is contained in:
andrzejber 2026-08-07 22:24:03 +02:00
parent 1588ac6d17
commit bdf3ee5d0e

View File

@ -48,7 +48,11 @@ private def render_description_attachment(attachment : JSON::Any, fallback : Str
source_url = source["url"]?.try &.as_s?
return if source_url.nil?
uri = URI.parse(source_url)
uri = begin
URI.parse(source_url)
rescue URI::Error
return
end
return if uri.scheme != "https"
# Custom emoji URLs use either host; the existing /ggpht proxy serves the