Skip to content

Commit 7bdfadd

Browse files
committed
Include a Content-Length header with PUT/POST requests that do not include a body (fixes #422)
1 parent ba084b3 commit 7bdfadd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ protected Response StreamRESTRequest(CloudIdentity identity, Uri absoluteUri, Ht
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>
613614
/// <item>The <see cref="RequestSettings.ConnectionLimit"/> is set to <see cref="ConnectionLimit"/>.</item>
614615
/// <item>Other properties are set to the default values for <see cref="JsonRequestSettings"/>.</item>
615616
/// </list>
@@ -630,6 +631,7 @@ protected virtual RequestSettings BuildDefaultRequestSettings(IEnumerable<HttpSt
630631
RetryDelay = TimeSpan.FromMilliseconds(200),
631632
Non200SuccessCodes = non200SuccessCodesAggregate,
632633
UserAgent = UserAgentGenerator.UserAgent,
634+
AllowZeroContentLength = true,
633635
ConnectionLimit = ConnectionLimit,
634636
};
635637
}

0 commit comments

Comments
 (0)