From 07cd0b041fbb0dd7e7259e62bca656ec00e1457b Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 21 Nov 2016 22:07:26 +0100 Subject: [PATCH] BUG-2071: Fixed Box upload, there seems to be a change in the URL behavior of the site. --- GreenshotPlugin/Controls/OAuthLoginForm.cs | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/GreenshotPlugin/Controls/OAuthLoginForm.cs b/GreenshotPlugin/Controls/OAuthLoginForm.cs index 9c9bcf68d..3f370b543 100644 --- a/GreenshotPlugin/Controls/OAuthLoginForm.cs +++ b/GreenshotPlugin/Controls/OAuthLoginForm.cs @@ -29,25 +29,22 @@ namespace GreenshotPlugin.Controls { /// /// The OAuthLoginForm is used to allow the user to authorize Greenshot with an "Oauth" application /// - public partial class OAuthLoginForm : Form { + public sealed partial class OAuthLoginForm : Form { private static readonly ILog LOG = LogManager.GetLogger(typeof(OAuthLoginForm)); private readonly string _callbackUrl; private IDictionary _callbackParameters; - public IDictionary CallbackParameters { - get { - return _callbackParameters; - } - } - - public bool IsOk { - get { - return DialogResult == DialogResult.OK; - } - } - + public IDictionary CallbackParameters => _callbackParameters; + + public bool IsOk => DialogResult == DialogResult.OK; + public OAuthLoginForm(string browserTitle, Size size, string authorizationLink, string callbackUrl) { _callbackUrl = callbackUrl; + // Fix for BUG-2071 + if (callbackUrl.EndsWith("/")) + { + _callbackUrl = callbackUrl.Substring(0, callbackUrl.Length - 1); + } InitializeComponent(); ClientSize = size; Icon = GreenshotResources.getGreenshotIcon();