Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Unicode characters in httpd auth headers #1031

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/controllers/api/base_controller/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def valid_ui_session?

def authenticate_with_jwt
timeout = ::Settings.api.authentication_timeout.to_i_with_method
user = User.authenticate(request.headers["X-REMOTE-USER"], "", request, :require_user => true, :timeout => timeout)
user_header = request.headers["X-REMOTE-USER"]&.force_encoding("UTF-8")
user = User.authenticate(user_header, "", request, :require_user => true, :timeout => timeout)
auth_user(user.userid)
rescue => e
raise AuthenticationError, "Failed to Authenticate with JWT - error #{e}"
Expand Down