diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fetch_link_card_service.rb | 2 | ||||
-rw-r--r-- | app/services/fetch_oembed_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 5d4a7c303..91141c1f5 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -45,7 +45,7 @@ class FetchLinkCardService < BaseService def html return @html if defined?(@html) - Request.new(:get, @url).perform do |res| + Request.new(:get, @url).add_headers('Accept' => 'text/html').perform do |res| if res.code == 200 && res.mime_type == 'text/html' @html = res.body_with_limit @html_charset = res.charset diff --git a/app/services/fetch_oembed_service.rb b/app/services/fetch_oembed_service.rb index 76d971bc5..67e33875c 100644 --- a/app/services/fetch_oembed_service.rb +++ b/app/services/fetch_oembed_service.rb @@ -93,7 +93,7 @@ class FetchOEmbedService def html return @html if defined?(@html) - @html = @options[:html] || Request.new(:get, @url).perform do |res| + @html = @options[:html] || Request.new(:get, @url).add_headers('Accept' => 'text/html').perform do |res| res.code != 200 || res.mime_type != 'text/html' ? nil : res.body_with_limit end end |