mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-17 19:40:19 -04:00
Merge remote-tracking branch 'upstream/release-v1.37'
This commit is contained in:
commit
9e81bc6b08
140 changed files with 4734 additions and 2016 deletions
|
@ -65,13 +65,9 @@ from synapse.http.client import (
|
|||
read_body_with_max_size,
|
||||
)
|
||||
from synapse.http.federation.matrix_federation_agent import MatrixFederationAgent
|
||||
from synapse.logging import opentracing
|
||||
from synapse.logging.context import make_deferred_yieldable
|
||||
from synapse.logging.opentracing import (
|
||||
inject_active_span_byte_dict,
|
||||
set_tag,
|
||||
start_active_span,
|
||||
tags,
|
||||
)
|
||||
from synapse.logging.opentracing import set_tag, start_active_span, tags
|
||||
from synapse.types import ISynapseReactor, JsonDict
|
||||
from synapse.util import json_decoder
|
||||
from synapse.util.async_helpers import timeout_deferred
|
||||
|
@ -322,7 +318,9 @@ class MatrixFederationHttpClient:
|
|||
# We need to use a DNS resolver which filters out blacklisted IP
|
||||
# addresses, to prevent DNS rebinding.
|
||||
self.reactor = BlacklistingReactorWrapper(
|
||||
hs.get_reactor(), None, hs.config.federation_ip_range_blacklist
|
||||
hs.get_reactor(),
|
||||
hs.config.federation_ip_range_whitelist,
|
||||
hs.config.federation_ip_range_blacklist,
|
||||
) # type: ISynapseReactor
|
||||
|
||||
user_agent = hs.version_string
|
||||
|
@ -497,7 +495,7 @@ class MatrixFederationHttpClient:
|
|||
|
||||
# Inject the span into the headers
|
||||
headers_dict = {} # type: Dict[bytes, List[bytes]]
|
||||
inject_active_span_byte_dict(headers_dict, request.destination)
|
||||
opentracing.inject_header_dict(headers_dict, request.destination)
|
||||
|
||||
headers_dict[b"User-Agent"] = [self.version_string_bytes]
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
# limitations under the License.
|
||||
|
||||
""" This module contains base REST classes for constructing REST servlets. """
|
||||
|
||||
import logging
|
||||
from typing import Dict, Iterable, List, Optional, overload
|
||||
|
||||
|
@ -295,6 +294,30 @@ def parse_strings_from_args(
|
|||
return default
|
||||
|
||||
|
||||
@overload
|
||||
def parse_string_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[str] = None,
|
||||
required: Literal[True] = True,
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> str:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def parse_string_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[str] = None,
|
||||
required: bool = False,
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> Optional[str]:
|
||||
...
|
||||
|
||||
|
||||
def parse_string_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
|
@ -431,7 +454,7 @@ class RestServlet:
|
|||
"""
|
||||
|
||||
def register(self, http_server):
|
||||
""" Register this servlet with the given HTTP server. """
|
||||
"""Register this servlet with the given HTTP server."""
|
||||
patterns = getattr(self, "PATTERNS", None)
|
||||
if patterns:
|
||||
for method in ("GET", "PUT", "POST", "DELETE"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue