Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

api: URL-quote password when testing authentication API.

Tim Abbotteae14baa0554
diff --git a/zerver/openapi/curl_param_value_generators.py b/zerver/openapi/curl_param_value_generators.py
index 421ce4faa3d..4a1b02b4a82 100644
--- a/zerver/openapi/curl_param_value_generators.py
+++ b/zerver/openapi/curl_param_value_generators.py
@@ -6,6 +6,7 @@
# fetching of appropriate parameter values to use when running the
# cURL examples as part of the tools/test-api test suite.
+import urllib.parse
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
@@ -78,10 +79,11 @@ def patch_openapi_example_values(
def fetch_api_key() -> Dict[str, object]:
email = helpers.example_email("iago")
password = initial_password(email)
+ assert password is not None
return {
"username": email,
- "password": password,
+ "password": urllib.parse.quote(password),
}
@openapi_param_value_generator(["/messages/{message_id}:get", "/messages/{message_id}/history:get",