Skip to content

Commit

Permalink
Handle Unicode characters in httpd auth headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Apr 21, 2021
1 parent abf5c3b commit 73ee0df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/api/base_controller/authentication.rb
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

0 comments on commit 73ee0df

Please sign in to comment.