Skip to content

Commit

Permalink
[RD-35945] Fixed encoding for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathew Seymour committed Aug 12, 2019
1 parent c4d7e24 commit 6c4c342
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/e2etests/chrome/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_standard_auth_page(self):

self.assertTrue(len(responses_received) >= 2) # Headed browser creates extra requests
self.assertIn(200, responses_received)
self.assertNotIn(401, responses_received)
self.assertNotIn(401, responses_received) # Devtools genuinely doesn't report these


class Test_ChromeInterface_set_baic_auth_headed(
Expand Down
11 changes: 5 additions & 6 deletions tests/e2etests/testsite/start.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import multiprocessing
from base64 import b64decode

import time
from base64 import b64decode

import cherrypy

Expand Down Expand Up @@ -63,10 +62,10 @@ def is_authenticated(authorized_username, authorized_password):

if "Authorization" in cherrypy.request.headers:

this_username, this_password = tuple(
b64decode(cherrypy.request.headers["Authorization"].split("Basic ")[1]).split(":")
)

auth_string = str(cherrypy.request.headers["Authorization"])
secret = auth_string.split("Basic ")[1]
credentials = b64decode(secret).decode()
this_username, this_password = tuple(credentials.split(":"))
if (this_username == authorized_username) and (this_password == authorized_password):
return True
return False
Expand Down

0 comments on commit 6c4c342

Please sign in to comment.