Skip to content

Commit 98f05f7

Browse files
authored
Merge pull request #227 from opentok/fix-e2ee-type
Fix e2ee type
2 parents 132c8d4 + c1927b3 commit 98f05f7

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.7.0
2+
current_version = 3.7.1
33
commit = True
44
tag = False
55

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Release v3.7.1
2+
- Fixed an issue with end-to-end encryption not being called correctly when creating a new session
3+
14
# Release v3.7.0
25
- Added the `maxBitrate` parameter to the `Client.start_broadcast` method
36
- Added the `hlsStatus` parameter to the `Broadcast object`

opentok/opentok.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -458,24 +458,23 @@ def create_session(
458458
).format(location)
459459
)
460460
options[u("location")] = location
461-
options["e2ee"] = e2ee
461+
options["e2ee"] = str(e2ee).lower()
462462

463463
try:
464464
logger.debug(
465465
"POST to %r with params %r, headers %r, proxies %r",
466466
self.endpoints.session_url(),
467467
options,
468-
self.headers(),
468+
{**self.get_headers(), "Accept": "application/json"},
469469
self.proxies,
470470
)
471471
response = requests.post(
472472
self.endpoints.get_session_url(),
473473
data=options,
474-
headers=self.get_headers(),
474+
headers={**self.get_headers(), "Accept": "application/json"},
475475
proxies=self.proxies,
476476
timeout=self.timeout,
477477
)
478-
479478
response.encoding = "utf-8"
480479

481480
if response.status_code == 403:

opentok/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# see: http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers
2-
__version__ = "3.7.0"
2+
__version__ = "3.7.1"
33

tests/test_session_creation.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def test_create_default_session(self):
3939

4040
validate_jwt_header(self, httpretty.last_request().headers[u("x-opentok-auth")])
4141
expect(httpretty.last_request().headers[u("user-agent")]).to(
42-
equal(u("OpenTok-Python-SDK/") + __version__ + ' python/' + platform.python_version())
42+
equal(
43+
u("OpenTok-Python-SDK/")
44+
+ __version__
45+
+ " python/"
46+
+ platform.python_version()
47+
)
4348
)
4449
body = parse_qs(httpretty.last_request().body)
4550
expect(body).to(have_key(b("p2p.preference"), [b("enabled")]))
@@ -310,7 +315,7 @@ def test_create_session_with_e2ee(self):
310315
session = self.opentok.create_session(e2ee=True)
311316

312317
body = parse_qs(httpretty.last_request().body)
313-
expect(body).to(have_key(b("e2ee"), [b"True"]))
318+
expect(body).to(have_key(b("e2ee"), [b"true"]))
314319
expect(session).to(be_a(Session))
315320
expect(session).to(
316321
have_property(

0 commit comments

Comments
 (0)