From a602efe95d8158b34cae4103ad0771d676ce0d79 Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 5 Sep 2022 10:21:15 +0200 Subject: [PATCH] B #~: Fix VMRC with users passwords with special chars (#2271) (cherry picked from commit f3f28e322729a75f55f878064847d5e0d66786e0) --- src/sunstone/public/app/utils/fireedge-validator.js | 2 +- src/sunstone/sunstone-server.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/utils/fireedge-validator.js b/src/sunstone/public/app/utils/fireedge-validator.js index a8b8906a6d..aca1aa7173 100644 --- a/src/sunstone/public/app/utils/fireedge-validator.js +++ b/src/sunstone/public/app/utils/fireedge-validator.js @@ -52,7 +52,7 @@ define(function (require) { */ if (sunstone_fireedge_active && fireedge_token == "" && fireedge_endpoint) { $.ajax({ - url: "/fireedge", + url: "/auth_fireedge", type: "GET", success: function(data) { set_fireedge_token(data.token); diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index e6458239a9..1dfea2337f 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -564,7 +564,7 @@ helpers do session[:mode] = $conf[:mode] if RUBY_VERSION > '2.0.0' - auth = request.env['HTTP_AUTHORIZATION'].match(/(?\w+) (?\w+)/) + auth = request.env['HTTP_AUTHORIZATION'].match(/(?\w+) (?(\w|\W)+)/) session[:auth] = auth[:pass] else auth = request.env['HTTP_AUTHORIZATION'].split(" ") @@ -1014,7 +1014,7 @@ end ############################################################################## # GET FireEdge token ############################################################################## -get '/fireedge' do +get '/auth_fireedge' do if !session[:fireedge_token].empty? response = {:token => session[:fireedge_token]} [200, response.to_json]