Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Be more lenient when parsing the version for oEmbed responses. #11065

Merged
merged 4 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove unused client parameter for OEmbedProvider.
  • Loading branch information
clokep committed Oct 12, 2021
commit e2016a3e8497963a00cd5c14cb11fbc4d8183c3f
4 changes: 1 addition & 3 deletions synapse/rest/media/v1/oembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import attr

from synapse.http.client import SimpleHttpClient
from synapse.types import JsonDict
from synapse.util import json_decoder

Expand Down Expand Up @@ -48,7 +47,7 @@ class OEmbedProvider:
requesting/parsing oEmbed content.
"""

def __init__(self, hs: "HomeServer", client: SimpleHttpClient):
def __init__(self, hs: "HomeServer"):
self._oembed_patterns = {}
for oembed_endpoint in hs.config.oembed.oembed_patterns:
api_endpoint = oembed_endpoint.api_endpoint
Expand All @@ -69,7 +68,6 @@ def __init__(self, hs: "HomeServer", client: SimpleHttpClient):
# Iterate through each URL pattern and point it to the endpoint.
for pattern in oembed_endpoint.url_patterns:
self._oembed_patterns[pattern] = api_endpoint
self._client = client

def get_oembed_url(self, url: str) -> Optional[str]:
"""
Expand Down
2 changes: 1 addition & 1 deletion synapse/rest/media/v1/preview_url_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(
self.primary_base_path = media_repo.primary_base_path
self.media_storage = media_storage

self._oembed = OEmbedProvider(hs, self.client)
self._oembed = OEmbedProvider(hs)

# We run the background jobs if we're the instance specified (or no
# instance is specified, where we assume there is only one instance
Expand Down