summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:08:03 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:08:03 +0000
commit6eb622846a9b71ce614798b8028f605b2f3a431a (patch)
tree17f8897a6e177408fa83c024bc92555bb7a033a2
parentMerge pull request #6125 from matrix-org/babolivier/deactivation-invite (diff)
parentEdit SimpleHttpClient to reference that header keys can be passed as str or b... (diff)
downloadsynapse-6eb622846a9b71ce614798b8028f605b2f3a431a.tar.xz
Edit SimpleHttpClient to reference that header keys can be passed as str or bytes (#6077)
-rw-r--r--changelog.d/6077.misc1
-rw-r--r--synapse/http/client.py12
2 files changed, 7 insertions, 6 deletions
diff --git a/changelog.d/6077.misc b/changelog.d/6077.misc
new file mode 100644

index 0000000000..31ac5b97a4 --- /dev/null +++ b/changelog.d/6077.misc
@@ -0,0 +1 @@ +Edit header dicts docstrings in SimpleHttpClient to note that `str` or `bytes` can be passed as header keys. diff --git a/synapse/http/client.py b/synapse/http/client.py
index 4098855c51..a7512c918e 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py
@@ -340,7 +340,7 @@ class SimpleHttpClient(object): Args: uri (str): args (dict[str, str|List[str]]): query params - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: @@ -384,7 +384,7 @@ class SimpleHttpClient(object): Args: uri (str): post_json (object): - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: @@ -427,7 +427,7 @@ class SimpleHttpClient(object): None. **Note**: The value of each key is assumed to be an iterable and *not* a string. - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: Deferred: Succeeds when we get *any* 2xx HTTP response, with the @@ -451,7 +451,7 @@ class SimpleHttpClient(object): None. **Note**: The value of each key is assumed to be an iterable and *not* a string. - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: Deferred: Succeeds when we get *any* 2xx HTTP response, with the @@ -495,7 +495,7 @@ class SimpleHttpClient(object): None. **Note**: The value of each key is assumed to be an iterable and *not* a string. - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: Deferred: Succeeds when we get *any* 2xx HTTP response, with the @@ -529,7 +529,7 @@ class SimpleHttpClient(object): Args: url (str): The URL to GET output_stream (file): File to write the response body to. - headers (dict[str, List[str]]|None): If not None, a map from + headers (dict[str|bytes, List[str|bytes]]|None): If not None, a map from header name to a list of values for that header Returns: A (int,dict,string,int) tuple of the file length, dict of the response