diff --git a/src/BirdMessenger/HttpClientExtension.cs b/src/BirdMessenger/HttpClientExtension.cs index 9a75c33..49b4f61 100644 --- a/src/BirdMessenger/HttpClientExtension.cs +++ b/src/BirdMessenger/HttpClientExtension.cs @@ -139,10 +139,9 @@ public static async Task TusHeadAsync(this HttpClient httpClien PreSendRequestEvent preSendRequestEvent = new PreSendRequestEvent(reqOption, httpReqMsg); await reqOption.OnPreSendRequestAsync(preSendRequestEvent); } - var response = await httpClient.SendAsync(httpReqMsg, ct); - if (response.StatusCode == HttpStatusCode.NotFound || - response.StatusCode == HttpStatusCode.Gone || - response.StatusCode == HttpStatusCode.Forbidden) + var response = await httpClient.SendAsync(httpReqMsg, ct); + if (response.StatusCode != HttpStatusCode.OK && + response.StatusCode != HttpStatusCode.NoContent) { throw new TusException($" head response statusCode is{response.StatusCode.ToString()} ",httpReqMsg,response); }