Skip to content

Commit

Permalink
Merge pull request #1031 from Fryguy/handle_unicode_chars_in_headers
Browse files Browse the repository at this point in the history
Handle Unicode characters in httpd auth headers

(cherry picked from commit 050a977)
  • Loading branch information
jrafanie authored and Fryguy committed Apr 22, 2021
1 parent ee80548 commit 15fdf4b
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 15fdf4b

Please sign in to comment.