From c0a83c0ee9be87af9a18bbeff7aaa0051bfa7723 Mon Sep 17 00:00:00 2001 From: RKrom Date: Sat, 13 Oct 2012 20:35:44 +0000 Subject: [PATCH] Small changes: added contentlength to upload and made the UrlEncode3986 public git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2141 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Core/NetworkHelper.cs | 1 + GreenshotPlugin/Core/OAuthHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GreenshotPlugin/Core/NetworkHelper.cs b/GreenshotPlugin/Core/NetworkHelper.cs index 804d5ebbc..9aa63e357 100644 --- a/GreenshotPlugin/Core/NetworkHelper.cs +++ b/GreenshotPlugin/Core/NetworkHelper.cs @@ -391,6 +391,7 @@ namespace GreenshotPlugin.Core { /// public void Upload(HttpWebRequest webRequest) { webRequest.ContentType = contentType; + webRequest.ContentLength = fileSize; using (var requestStream = webRequest.GetRequestStream()) { WriteToStream(requestStream); } diff --git a/GreenshotPlugin/Core/OAuthHelper.cs b/GreenshotPlugin/Core/OAuthHelper.cs index 1f0896394..971c8cff8 100644 --- a/GreenshotPlugin/Core/OAuthHelper.cs +++ b/GreenshotPlugin/Core/OAuthHelper.cs @@ -225,7 +225,7 @@ namespace GreenshotPlugin.Core { /// The value to Url encode /// Returns a Url encoded string /// This will cause an ignorable CA1055 warning in code analysis. - private static string UrlEncode3986(string value) { + public static string UrlEncode3986(string value) { StringBuilder result = new StringBuilder(); foreach (char symbol in value) {