Skip to content

Commit 626bef5

Browse files
committed
Revert "Excluded all non "oauth_" parameters from the signature for multipart requests."
This reverts commit 178ad4d.
1 parent 178ad4d commit 626bef5

9 files changed

+8
-702
lines changed

RestSharp/Authenticators/OAuth1Authenticator.cs

+8-26
Original file line numberDiff line numberDiff line change
@@ -169,32 +169,14 @@ private void AddOAuthData(IRestClient client, IRestRequest request, OAuthWorkflo
169169
// http://tools.ietf.org/html/rfc5849#section-3.4.1
170170
// if this change causes trouble we need to introduce a flag indicating the specific OAuth implementation level,
171171
// or implement a seperate class for each OAuth version
172-
if (!request.AlwaysMultipartFormData && !request.Files.Any())
173-
{
174-
foreach (var p in client.DefaultParameters.Where(p => p.Type == ParameterType.GetOrPost))
175-
{
176-
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
177-
}
178-
foreach (var p in request.Parameters.Where(p => p.Type == ParameterType.GetOrPost))
179-
{
180-
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
181-
}
182-
}
183-
else
184-
{
185-
// if we are sending a multipart request, only the "oauth_" parameters should be included in the signature
186-
foreach (
187-
var p in
188-
client.DefaultParameters.Where(p => p.Type == ParameterType.GetOrPost && p.Name.StartsWith("oauth_")))
189-
{
190-
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
191-
}
192-
foreach (
193-
var p in request.Parameters.Where(p => p.Type == ParameterType.GetOrPost && p.Name.StartsWith("oauth_")))
194-
{
195-
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
196-
}
197-
}
172+
foreach (var p in client.DefaultParameters.Where(p => p.Type == ParameterType.GetOrPost))
173+
{
174+
parameters.Add( new WebPair( p.Name, p.Value.ToString() ) );
175+
}
176+
foreach (var p in request.Parameters.Where(p => p.Type == ParameterType.GetOrPost))
177+
{
178+
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
179+
}
198180

199181
switch (Type)
200182
{

UpgradeLog.XML

-4.18 KB
Binary file not shown.

UpgradeLog.htm

-28.2 KB
Binary file not shown.

_UpgradeReport_Files/UpgradeReport.css

-118
This file was deleted.

0 commit comments

Comments
 (0)