1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-11-25 07:37:08 +09:00

Fix OEmbed discovery not handling different URL variants in query (#12439)

Fix #12433
This commit is contained in:
Eugen Rochko 2019-11-21 19:03:07 +01:00 committed by GitHub
parent 2edf6d81cb
commit a60b602ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
}