Basic Authorization: User proper encoding for password
This commit is contained in:
@@ -125,7 +125,7 @@ database_path = {sharing_path}
|
|||||||
if config.auth_type == AuthType.HTPASSWD:
|
if config.auth_type == AuthType.HTPASSWD:
|
||||||
with open(user_path, "w") as f:
|
with open(user_path, "w") as f:
|
||||||
f.write(
|
f.write(
|
||||||
"""admin:adminpassword
|
"""admin:admi$pass#word
|
||||||
max:maxpassword
|
max:maxpassword
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -185,7 +185,7 @@ def login(
|
|||||||
|
|
||||||
if config.auth_type == AuthType.HTPASSWD:
|
if config.auth_type == AuthType.HTPASSWD:
|
||||||
page.fill('#loginscene input[data-name="user"]', "admin")
|
page.fill('#loginscene input[data-name="user"]', "admin")
|
||||||
page.fill('#loginscene input[data-name="password"]', "adminpassword")
|
page.fill('#loginscene input[data-name="password"]', "admi$pass#word")
|
||||||
page.click('button:has-text("Next")')
|
page.click('button:has-text("Next")')
|
||||||
|
|
||||||
expect(page.locator("#collectionsscene")).to_be_visible()
|
expect(page.locator("#collectionsscene")).to_be_visible()
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function to_error_message(request) {
|
|||||||
*/
|
*/
|
||||||
export function get_auth_header(user, password) {
|
export function get_auth_header(user, password) {
|
||||||
if (user !== null && password !== null && password !== "") {
|
if (user !== null && password !== null && password !== "") {
|
||||||
return 'Basic ' + btoa(user + ':' + encodeURIComponent(password));
|
return 'Basic ' + btoa(user + ':' + password);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user