Merge pull request #204 from ewilly/dev

Fix auth_header parsing when password contains semicolon
This commit is contained in:
Alexandre Aubin 2023-01-19 16:54:12 +01:00 committed by GitHub
commit a3a4543850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,7 +276,7 @@ function validate_or_clear_basic_auth_header_provided_by_client()
-- Try to authenticate the user,
-- or remove the Auth header if not valid
_, _, user, password = string.find(ngx.decode_base64(b64_cred), "^(.+):(.+)$")
_, _, user, password = string.find(ngx.decode_base64(b64_cred), "^([^:]+):(.+)$")
user = authenticate(user, password)
if user then
logger.debug("User got authenticated through basic auth")