about summary refs log tree commit diff
path: root/app/services/fetch_oembed_service.rb
AgeCommit message (Collapse)Author
2023-02-08Apply Rubocop Style/NegatedIfElseCondition (#23451)Nick Schonning
2023-01-05Be more lenient with OEmbed detection and validation (#22533)Effy Elden
2021-10-21Fix some link previews being incorrectly generated from other prior links ↵Claire
(#16885) * Add tests * Fix some link previews being incorrectly generated from different prior links PR #12403 added a cache to avoid redundant queries when the OEmbed endpoint can be guessed from the URL. This caching mechanism is not perfectly correct as there is no guarantee that all pages from a given domain share the same OEmbed provider endpoint. This PR prevents the FetchOEmbedService from caching OEmbed endpoint that cannot be generalized by replacing a fully-qualified URL from the endpoint's parameters, greatly reducing the number of incorrect cached generalizations.
2021-02-12Fix YouTube embeds failing due to YouTube serving wrong OEmbed URLs (#15716)Eugen Rochko
2019-12-18Fix link crawler not specifying accepted content-type (#12646)ThibG
The link crawler expects HTML documents, so set the `Accept` header accordingly. Fixes #12618
2019-11-21Fix OEmbed discovery not handling different URL variants in query (#12439)Eugen Rochko
Fix #12433
2019-11-17Add cache for OEmbed endpoints to avoid extra HTTP requests (#12403)Eugen Rochko
* add youtube oembed endpoint * add check for oembed endpoint * change unless for a more readable if * clear blank lines * endpoint via https * Fix string literal in condition * use cache for endpoints * use cache for endpoints * clean up and adding check * clean up and remove redundant return * add html check * add false to return * use double quotes * use double quotes * Clean up
2019-01-14Fix undefined method error in sidekiq (#9807)Renato "Lond" Cerqueira
* Fix undefined method error in sidekiq Body can be not nil but still be empty, which causes a `NoMethodError: undefined method `[]' for nil:NilClass` further in the code. This checks for an empty body to avoid the issue. * Fix codeclimate issue
2018-09-10Handle relative URLs when fetching OEmbed/OpenGraph cards (#8669)ThibG
2018-05-02Slightly reduce RAM usage (#7301)Eugen Rochko
* No need to re-require sidekiq plugins, they are required via Gemfile * Add derailed_benchmarks tool, no need to require TTY gems in Gemfile * Replace ruby-oembed with FetchOEmbedService Reduce startup by 45382 allocated objects * Remove preloaded JSON-LD in favour of caching HTTP responses Reduce boot RAM by about 6 MiB * Fix tests * Fix test suite by stubbing out JSON-LD contexts