diff options
author | ThibG <thib@sitedethib.com> | 2019-12-18 16:56:06 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-12-18 16:56:06 +0100 |
commit | b364175e1b345e7f36955ba85b483ec2bdd8622d (patch) | |
tree | f0315e2b5f0b4ea952e5e285ad042ccd0bd6c80b /app/services/fetch_oembed_service.rb | |
parent | 68070e82ccadfef4f101653cf8456f15148c58b7 (diff) |
Fix link crawler not specifying accepted content-type (#12646)
The link crawler expects HTML documents, so set the `Accept`
header accordingly.
Fixes #12618
Diffstat (limited to 'app/services/fetch_oembed_service.rb')
-rw-r--r-- | app/services/fetch_oembed_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/fetch_oembed_service.rb b/app/services/fetch_oembed_service.rb index 76d971bc51c..67e33875c68 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 |