From fdbdbb25cfb61deefb98e75a098f7f610e2180c9 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Sun, 30 Dec 2018 02:45:12 +0100 Subject: [PATCH] Use Base64.strict_encode64 in discourse plugin Base64.encode64 adds unneded newlines. Discourse can handle the newlines, so this does not change the behaviour. --- plugins/discourse/app/controllers/discourse_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discourse/app/controllers/discourse_controller.rb b/plugins/discourse/app/controllers/discourse_controller.rb index cf98613d..e4cb795f 100644 --- a/plugins/discourse/app/controllers/discourse_controller.rb +++ b/plugins/discourse/app/controllers/discourse_controller.rb @@ -10,7 +10,7 @@ class DiscourseController < ApplicationController end def redirect_to_with_payload(url, payload) - base64_payload = Base64.encode64 payload.to_query + base64_payload = Base64.strict_encode64 payload.to_query sso = CGI::escape base64_payload sig = get_hmac_hex_string base64_payload redirect_to "#{url}#{url.include?('?') ? '&' : '?'}sso=#{sso}&sig=#{sig}"