mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:26:02 -04:00
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
This commit is contained in:
commit
754826a830
47 changed files with 686 additions and 197 deletions
|
@ -42,6 +42,8 @@ import random
|
|||
import sys
|
||||
import urllib
|
||||
from six.moves.urllib import parse as urlparse
|
||||
from six import string_types
|
||||
|
||||
|
||||
from prometheus_client import Counter
|
||||
|
||||
|
@ -549,7 +551,7 @@ class MatrixFederationHttpClient(object):
|
|||
|
||||
encoded_args = {}
|
||||
for k, vs in args.items():
|
||||
if isinstance(vs, basestring):
|
||||
if isinstance(vs, string_types):
|
||||
vs = [vs]
|
||||
encoded_args[k] = [v.encode("UTF-8") for v in vs]
|
||||
|
||||
|
@ -664,7 +666,7 @@ def check_content_type_is_json(headers):
|
|||
RuntimeError if the
|
||||
|
||||
"""
|
||||
c_type = headers.getRawHeaders("Content-Type")
|
||||
c_type = headers.getRawHeaders(b"Content-Type")
|
||||
if c_type is None:
|
||||
raise RuntimeError(
|
||||
"No Content-Type header"
|
||||
|
@ -681,7 +683,7 @@ def check_content_type_is_json(headers):
|
|||
def encode_query_args(args):
|
||||
encoded_args = {}
|
||||
for k, vs in args.items():
|
||||
if isinstance(vs, basestring):
|
||||
if isinstance(vs, string_types):
|
||||
vs = [vs]
|
||||
encoded_args[k] = [v.encode("UTF-8") for v in vs]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue