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: Fix encoding of strings in video calls endpoint.

Gaurav Pandey00647b6fa710
diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md
index b13b198e3ae..0358680faaf 100644
--- a/templates/zerver/api/changelog.md
+++ b/templates/zerver/api/changelog.md
@@ -10,6 +10,21 @@ below features are supported.
## Changes in Zulip 4.0
+**Feature level 63**
+
+* `PATCH /settings/notifications`: Removed unnecessary JSON-encoding of string
+ parameter `notification_sound`.
+* `PATCH /settings/display`: Removed unnecessary JSON-encoding of string
+ parameter `default_language`.
+* `POST /users/me/tutorial_status`: Removed unnecessary JSON-encoding of string
+ parameter `status`.
+* `POST /realm/domains`: Removed unnecessary JSON-encoding of string
+ parameter `domain`.
+* `PATCH /default_stream_groups/{user_id}`: Removed unnecessary JSON-encoding of string
+ parameters `new_group_name` and `new_description`.
+* `POST /users/me/hotspots`: Removed unnecessary JSON-encoding of string
+ parameter `hotspot`.
+
**Feature level 62**
* Added `moderators only` option for `wildcard_mention_policy`.
diff --git a/version.py b/version.py
index c345d177f85..8927f095ecb 100644
--- a/version.py
+++ b/version.py
@@ -30,7 +30,7 @@ DESKTOP_WARNING_VERSION = "5.2.0"
#
# Changes should be accompanied by documentation explaining what the
# new level means in templates/zerver/api/changelog.md.
-API_FEATURE_LEVEL = 62
+API_FEATURE_LEVEL = 63
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump
diff --git a/zerver/tests/test_create_video_call.py b/zerver/tests/test_create_video_call.py
index a281fdb5006..b5ba928895b 100644
--- a/zerver/tests/test_create_video_call.py
+++ b/zerver/tests/test_create_video_call.py
@@ -176,8 +176,8 @@ class TestVideoCall(ZulipTestCase):
self.assert_json_success(response)
self.assertEqual(
response.json()["url"],
- "/calls/bigbluebutton/join?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22"
- "&checksum=%22697939301a52d3a2f0b3c3338895c1a5ab528933%22",
+ "/calls/bigbluebutton/join?meeting_id=zulip-1&password=AAAAAAAAAA"
+ "&checksum=697939301a52d3a2f0b3c3338895c1a5ab528933",
)
@responses.activate
@@ -189,7 +189,7 @@ class TestVideoCall(ZulipTestCase):
)
response = self.client_get(
"/calls/bigbluebutton/join",
- {"meeting_id": '"zulip-1"', "password": '"a"', "checksum": '"check"'},
+ {"meeting_id": "zulip-1", "password": "a", "checksum": "check"},
)
self.assertEqual(response.status_code, 302)
self.assertEqual(isinstance(response, HttpResponseRedirect), True)
@@ -209,7 +209,7 @@ class TestVideoCall(ZulipTestCase):
)
response = self.client_get(
"/calls/bigbluebutton/join",
- {"meeting_id": '"zulip-1"', "password": '"a"', "checksum": '"check"'},
+ {"meeting_id": "zulip-1", "password": "a", "checksum": "check"},
)
self.assert_json_error(response, "Error authenticating to the Big Blue Button server.")
@@ -224,7 +224,7 @@ class TestVideoCall(ZulipTestCase):
)
response = self.client_get(
"/calls/bigbluebutton/join",
- {"meeting_id": '"zulip-1"', "password": '"a"', "checksum": '"check"'},
+ {"meeting_id": "zulip-1", "password": "a", "checksum": "check"},
)
self.assert_json_error(response, "Error connecting to the Big Blue Button server.")
@@ -238,7 +238,7 @@ class TestVideoCall(ZulipTestCase):
)
response = self.client_get(
"/calls/bigbluebutton/join",
- {"meeting_id": '"zulip-1"', "password": '"a"', "checksum": '"check"'},
+ {"meeting_id": "zulip-1", "password": "a", "checksum": "check"},
)
self.assert_json_error(response, "Big Blue Button server returned an unexpected error.")
@@ -246,6 +246,6 @@ class TestVideoCall(ZulipTestCase):
with self.settings(BIG_BLUE_BUTTON_SECRET=None, BIG_BLUE_BUTTON_URL=None):
response = self.client_get(
"/calls/bigbluebutton/join",
- {"meeting_id": '"zulip-1"', "password": '"a"', "checksum": '"check"'},
+ {"meeting_id": "zulip-1", "password": "a", "checksum": "check"},
)
self.assert_json_error(response, "Big Blue Button is not configured.")
diff --git a/zerver/views/video_calls.py b/zerver/views/video_calls.py
index 1dc7c5ede7f..1b27a2976c0 100644
--- a/zerver/views/video_calls.py
+++ b/zerver/views/video_calls.py
@@ -188,9 +188,9 @@ def get_bigbluebutton_url(request: HttpRequest, user_profile: UserProfile) -> Ht
"/calls/bigbluebutton/join",
urlencode(
{
- "meeting_id": '"' + id + '"',
- "password": '"' + password + '"',
- "checksum": '"' + checksum + '"',
+ "meeting_id": id,
+ "password": password,
+ "checksum": checksum,
}
),
)
@@ -207,9 +207,9 @@ def get_bigbluebutton_url(request: HttpRequest, user_profile: UserProfile) -> Ht
@has_request_variables
def join_bigbluebutton(
request: HttpRequest,
- meeting_id: str = REQ(json_validator=check_string),
- password: str = REQ(json_validator=check_string),
- checksum: str = REQ(json_validator=check_string),
+ meeting_id: str = REQ(),
+ password: str = REQ(),
+ checksum: str = REQ(),
) -> HttpResponse:
if settings.BIG_BLUE_BUTTON_URL is None or settings.BIG_BLUE_BUTTON_SECRET is None:
return json_error(_("Big Blue Button is not configured."))