From 9a6e7780c70e288b1c129099575048004923ad87 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 18 Sep 2012 19:18:28 +0000 Subject: [PATCH] Added missing PUT logic, now Dropbox works too. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2052 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Core/OAuthHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GreenshotPlugin/Core/OAuthHelper.cs b/GreenshotPlugin/Core/OAuthHelper.cs index 23d5e686c..3b814d869 100644 --- a/GreenshotPlugin/Core/OAuthHelper.cs +++ b/GreenshotPlugin/Core/OAuthHelper.cs @@ -404,7 +404,7 @@ namespace GreenshotPlugin.Core { IDictionary requestParameters = null; // Add oAuth values as HTTP headers, if this is allowed StringBuilder authHeader = null; - if (HTTPMethod.POST == method && UseHTTPHeadersForAuthorization) { + if ((HTTPMethod.POST == method || HTTPMethod.PUT == method) && UseHTTPHeadersForAuthorization) { authHeader = new StringBuilder(); requestParameters = new Dictionary(); foreach (string parameterKey in parameters.Keys) { @@ -440,7 +440,7 @@ namespace GreenshotPlugin.Core { webRequest.Headers.Add("Authorization: OAuth " + authHeader.ToString()); } - if (HTTPMethod.POST == method && postData == null && requestParameters != null && requestParameters.Count > 0) { + if ( (HTTPMethod.POST == method || HTTPMethod.PUT == method) && postData == null && requestParameters != null && requestParameters.Count > 0) { StringBuilder form = new StringBuilder(); foreach (string parameterKey in requestParameters.Keys) { form.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "{0}={1}&", UrlEncode3986(parameterKey), UrlEncode3986(parameters[parameterKey]));