Skip to content

Commit 087baed

Browse files
committed
Merge pull request #426 from sharwell/fix-422
Include a Content-Length header with all PUT/POST requests
2 parents 8edc42f + 1b3350b commit 087baed

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/corelib/Providers/Rackspace/ProviderBase`1.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,10 +606,12 @@ protected Response StreamRESTRequest(CloudIdentity identity, Uri absoluteUri, Ht
606606
/// The base implementation returns a <see cref="JsonRequestSettings"/> object initialized with the following values.
607607
///
608608
/// <list type="bullet">
609-
/// <item>The <see cref="RequestSettings.RetryCount"/> is 2.</item>
609+
/// <item>The <see cref="RequestSettings.RetryCount"/> is 0.</item>
610610
/// <item>The <see cref="RequestSettings.RetryDelay"/> is 200 milliseconds.</item>
611611
/// <item>The <see cref="RequestSettings.Non200SuccessCodes"/> contains <see cref="HttpStatusCode.Unauthorized"/> and <see cref="HttpStatusCode.Conflict"/>, along with the values in <paramref name="non200SuccessCodes"/> (if any).</item>
612612
/// <item>The <see cref="RequestSettings.UserAgent"/> is set to <see cref="UserAgentGenerator.UserAgent"/>.</item>
613+
/// <item>The <see cref="RequestSettings.AllowZeroContentLength"/> is set to <see langword="true"/>.</item>
614+
/// <item>The <see cref="RequestSettings.ConnectionLimit"/> is set to <see cref="ConnectionLimit"/>.</item>
613615
/// <item>Other properties are set to the default values for <see cref="JsonRequestSettings"/>.</item>
614616
/// </list>
615617
///
@@ -629,6 +631,7 @@ protected virtual RequestSettings BuildDefaultRequestSettings(IEnumerable<HttpSt
629631
RetryDelay = TimeSpan.FromMilliseconds(200),
630632
Non200SuccessCodes = non200SuccessCodesAggregate,
631633
UserAgent = UserAgentGenerator.UserAgent,
634+
AllowZeroContentLength = true,
632635
ConnectionLimit = ConnectionLimit,
633636
};
634637
}

src/testing/integration/Providers/Rackspace/UserObjectStorageTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ public void TestCreateObjectWithMetadata()
16061606
[TestMethod]
16071607
[TestCategory(TestCategories.User)]
16081608
[TestCategory(TestCategories.ObjectStorage)]
1609-
[DeploymentItem("DarkKnightRises.jpg")]
1609+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
16101610
public void TestCreateLargeObject()
16111611
{
16121612
IObjectStorageProvider provider = Bootstrapper.CreateObjectStorageProvider();
@@ -1648,7 +1648,7 @@ public void TestCreateLargeObject()
16481648
[TestMethod]
16491649
[TestCategory(TestCategories.User)]
16501650
[TestCategory(TestCategories.ObjectStorage)]
1651-
[DeploymentItem("DarkKnightRises.jpg")]
1651+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
16521652
public void TestVerifyLargeObjectETag()
16531653
{
16541654
IObjectStorageProvider provider = Bootstrapper.CreateObjectStorageProvider();
@@ -1698,7 +1698,7 @@ public void TestVerifyLargeObjectETag()
16981698
[TestMethod]
16991699
[TestCategory(TestCategories.User)]
17001700
[TestCategory(TestCategories.ObjectStorage)]
1701-
[DeploymentItem("DarkKnightRises.jpg")]
1701+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
17021702
public void TestExtractArchiveTar()
17031703
{
17041704
CloudFilesProvider provider = (CloudFilesProvider)Bootstrapper.CreateObjectStorageProvider();
@@ -1750,7 +1750,7 @@ public void TestExtractArchiveTar()
17501750
[TestMethod]
17511751
[TestCategory(TestCategories.User)]
17521752
[TestCategory(TestCategories.ObjectStorage)]
1753-
[DeploymentItem("DarkKnightRises.jpg")]
1753+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
17541754
public void TestExtractArchiveTarGz()
17551755
{
17561756
CloudFilesProvider provider = (CloudFilesProvider)Bootstrapper.CreateObjectStorageProvider();
@@ -1807,7 +1807,7 @@ public void TestExtractArchiveTarGz()
18071807
[TestMethod]
18081808
[TestCategory(TestCategories.User)]
18091809
[TestCategory(TestCategories.ObjectStorage)]
1810-
[DeploymentItem("DarkKnightRises.jpg")]
1810+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
18111811
public void TestExtractArchiveTarBz2()
18121812
{
18131813
CloudFilesProvider provider = (CloudFilesProvider)Bootstrapper.CreateObjectStorageProvider();
@@ -1863,7 +1863,7 @@ public void TestExtractArchiveTarBz2()
18631863
[TestMethod]
18641864
[TestCategory(TestCategories.User)]
18651865
[TestCategory(TestCategories.ObjectStorage)]
1866-
[DeploymentItem("DarkKnightRises.jpg")]
1866+
[DeploymentItem("Providers/Rackspace/CloudFiles/DarkKnightRises.jpg")]
18671867
public void TestExtractArchiveTarGzCreateContainer()
18681868
{
18691869
CloudFilesProvider provider = (CloudFilesProvider)Bootstrapper.CreateObjectStorageProvider();

src/testing/integration/integration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
</ItemGroup>
138138
<ItemGroup>
139139
<Content Include="Providers\Rackspace\CloudFiles\DarkKnightRises.jpg">
140-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
140+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
141141
</Content>
142142
</ItemGroup>
143143
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

0 commit comments

Comments
 (0)