about summary refs log tree commit diff
path: root/spec/fixtures/requests
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-10-21 20:39:35 +0200
committerGitHub <noreply@github.com>2021-10-21 20:39:35 +0200
commitec059317fad4fc5f1ed45a72cbae48edafcb586d (patch)
tree65ed76eb93e6119fd8166010d4328961b1b3b20f /spec/fixtures/requests
parentb58d32cfe259d95ef28a61cbd863336350f2a3d9 (diff)
Fix some link previews being incorrectly generated from other prior links (#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.
Diffstat (limited to 'spec/fixtures/requests')
-rw-r--r--spec/fixtures/requests/oembed_youtube.html7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/fixtures/requests/oembed_youtube.html b/spec/fixtures/requests/oembed_youtube.html
new file mode 100644
index 000000000..1508e4dd9
--- /dev/null
+++ b/spec/fixtures/requests/oembed_youtube.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <link rel="alternate" type="application/json+oembed" href="https://www.youtube.com/oembed?format=json&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIPSbNdBmWKE" title="What is Mastodon?">
+  </head>
+  <body></body>
+</html>