about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-11-21 19:03:07 +0100
committerGitHub <noreply@github.com>2019-11-21 19:03:07 +0100
commita60b602ade955c8ce620facae160ffabd7893d4b (patch)
treec3d5a014704043a27da321b9f801a0171d7f53b0 /app/services
parent2edf6d81cba25555814046d7b9f260872c2c9545 (diff)
Fix OEmbed discovery not handling different URL variants in query (#12439)
Fix #12433
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fetch_oembed_service.rb2
1 files changed, 1 insertions, 1 deletions
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,
     }