From: Eugen Rochko Date: Thu, 21 Nov 2019 18:03:07 +0000 (+0100) Subject: Fix OEmbed discovery not handling different URL variants in query (#12439) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=a60b602ade955c8ce620facae160ffabd7893d4b;p=mastodon.git Fix OEmbed discovery not handling different URL variants in query (#12439) Fix #12433 --- diff --git a/app/services/fetch_oembed_service.rb b/app/services/fetch_oembed_service.rb index 4f8498c62..76d971bc5 100644 --- a/app/services/fetch_oembed_service.rb +++ b/app/services/fetch_oembed_service.rb @@ -58,7 +58,7 @@ class FetchOEmbedService url_domain = Addressable::URI.parse(@url).normalized_host endpoint_hash = { - endpoint: @endpoint_url.gsub(URI.encode_www_form_component(@url), '{url}'), + endpoint: @endpoint_url.gsub(/(=(http[s]?(%3A|:)(\/\/|%2F%2F)))([^&]*)/i, '={url}'), format: @format, }