Skip to content

Commit 1694977

Browse files
committed
consider Http Status Code OK when waiting for long running operations due to a change in the Api Management Rest API
1 parent b9c4361 commit 1694977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/code/common/Http.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public static Request CreateRequest(this HttpPipeline pipeline, Uri uri, Request
253253
private static async ValueTask<Response> WaitForLongRunningOperation(this HttpPipeline pipeline, Response response, CancellationToken cancellationToken)
254254
{
255255
var updatedResponse = response;
256-
while ((updatedResponse.Status == ((int)HttpStatusCode.Accepted))
256+
while (updatedResponse.Status is (int)HttpStatusCode.OK or (int)HttpStatusCode.Created or (int)HttpStatusCode.Accepted
257257
&& updatedResponse.Headers.TryGetValue("Location", out var locationHeaderValue)
258258
&& Uri.TryCreate(locationHeaderValue, UriKind.Absolute, out var locationUri)
259259
&& locationUri is not null)

0 commit comments

Comments
 (0)