Skip to content

Commit 47e3ed7

Browse files
author
Michael Hallett
committed
Merge branch 'drusellers-AddHeader'
2 parents d3507c9 + 00f8776 commit 47e3ed7

File tree

8 files changed

+49
-11
lines changed

8 files changed

+49
-11
lines changed

.nuget/Signed/RestSharp.Build.dll

512 Bytes
Binary file not shown.

RestSharp.Build/RestSharp.Build.Signed.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3737
<Prefer32Bit>false</Prefer32Bit>
3838
</PropertyGroup>
39+
<PropertyGroup>
40+
<SignAssembly>true</SignAssembly>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<AssemblyOriginatorKeyFile>..\RestSharp.snk</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
3945
<ItemGroup>
4046
<Reference Include="Microsoft.Build.Framework" />
4147
<Reference Include="Microsoft.Build.Utilities.v3.5" />
@@ -50,6 +56,11 @@
5056
<Compile Include="NuSpecUpdateTask.cs" />
5157
<Compile Include="Properties\AssemblyInfo.cs" />
5258
</ItemGroup>
59+
<ItemGroup>
60+
<None Include="..\RestSharp.snk">
61+
<Link>RestSharp.snk</Link>
62+
</None>
63+
</ItemGroup>
5364
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5465
<PropertyGroup>
5566
<PostBuildEvent>copy /Y $(TargetPath) $(SolutionDir).nuget\Signed\$(TargetFileName)</PostBuildEvent>

RestSharp.IntegrationTests/RestSharp.IntegrationTests.Signed.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
<AssemblyOriginatorKeyFile>..\RestSharp.snk</AssemblyOriginatorKeyFile>
5353
</PropertyGroup>
5454
<ItemGroup>
55-
<Reference Include="nunit.framework">
56-
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
57-
</Reference>
5855
<Reference Include="System" />
5956
<Reference Include="System.Core">
6057
<RequiredTargetFramework>3.5</RequiredTargetFramework>

RestSharp.Net4/RestSharp.Net4.Signed.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
<DelaySign>false</DelaySign>
5050
</PropertyGroup>
5151
<ItemGroup>
52-
<Reference Include="nunit.framework">
53-
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
54-
</Reference>
5552
<Reference Include="System" />
5653
<Reference Include="System.Core" />
5754
<Reference Include="System.Xml.Linq" />

RestSharp.Tests/AddRangeTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace RestSharp.Tests
2+
{
3+
using Xunit;
4+
5+
public class AddRangeTests
6+
{
7+
[Fact]
8+
public void ShouldParseOutRangeSpecifier()
9+
{
10+
var restClient = new RestClient("http://localhost");
11+
var req = new RestRequest("bob", Method.GET);
12+
13+
req.AddHeader("Range", "pages=1-2");
14+
var resp = restClient.Execute(req);
15+
}
16+
}
17+
}

RestSharp.Tests/RestSharp.Tests.Signed.csproj

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
</DocumentationFile>
6161
<Prefer32Bit>false</Prefer32Bit>
6262
</PropertyGroup>
63+
<PropertyGroup>
64+
<SignAssembly>true</SignAssembly>
65+
</PropertyGroup>
66+
<PropertyGroup>
67+
<AssemblyOriginatorKeyFile>..\RestSharp.snk</AssemblyOriginatorKeyFile>
68+
</PropertyGroup>
6369
<ItemGroup>
6470
<Reference Include="Microsoft.Build.Framework" />
6571
<Reference Include="Microsoft.Build.Utilities.v3.5" />
@@ -83,6 +89,9 @@
8389
</Reference>
8490
</ItemGroup>
8591
<ItemGroup>
92+
<Compile Include="AddRangeTests.cs" />
93+
<Compile Include="InterfaceImplementationTests.cs" />
94+
<Compile Include="OAuthTests.cs" />
8695
<Compile Include="SampleClasses\EmployeeTracker.cs" />
8796
<Compile Include="SampleClasses\EnumTest.cs" />
8897
<Compile Include="SampleClasses\Goodreads.cs" />
@@ -124,7 +133,9 @@
124133
<Content Include="SampleData\boolean_from_number.xml">
125134
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
126135
</Content>
127-
<Content Include="SampleData\Goodreads.xml" />
136+
<Content Include="SampleData\Goodreads.xml">
137+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
138+
</Content>
128139
<Content Include="SampleData\iso8601datetimes.txt">
129140
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
130141
</Content>
@@ -207,6 +218,9 @@
207218
</BootstrapperPackage>
208219
</ItemGroup>
209220
<ItemGroup>
221+
<None Include="..\RestSharp.snk">
222+
<Link>RestSharp.snk</Link>
223+
</None>
210224
<None Include="packages.config" />
211225
<Content Include="SampleData\restsharp.nuspec">
212226
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

RestSharp.Tests/RestSharp.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
</ItemGroup>
8383
<ItemGroup>
8484
<Compile Include="InterfaceImplementationTests.cs" />
85+
<Compile Include="AddRangeTests.cs" />
8586
<Compile Include="OAuthTests.cs" />
8687
<Compile Include="SampleClasses\EmployeeTracker.cs" />
8788
<Compile Include="SampleClasses\EnumTest.cs" />

RestSharp/Http.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,17 +464,18 @@ private void ProcessResponseStream(Stream webResponseStream, HttpResponse respon
464464
#if FRAMEWORK
465465
private void AddRange(HttpWebRequest r, string range)
466466
{
467-
System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(range, "=(\\d+)-(\\d+)$");
467+
System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(range, "(\\w+)=(\\d+)-(\\d+)$");
468468

469469
if (!m.Success)
470470
{
471471
return;
472472
}
473473

474-
int from = Convert.ToInt32(m.Groups[1].Value);
475-
int to = Convert.ToInt32(m.Groups[2].Value);
474+
string rangeSpecifier = m.Groups[1].Value;
475+
int from = Convert.ToInt32(m.Groups[2].Value);
476+
int to = Convert.ToInt32(m.Groups[3].Value);
476477

477-
r.AddRange(from, to);
478+
r.AddRange(rangeSpecifier, from, to);
478479
}
479480
#endif
480481
}

0 commit comments

Comments
 (0)