Skip to content

Commit

Permalink
remove next
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Oct 26, 2023
1 parent f1bb422 commit 14fd122
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public HostHttpHandler(ResourceManager resourceManager) : base(resourceManager)
/// <param name="httpClient"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
protected override async Task HandleHttpClient(HttpContext httpClient)
protected override async Task<bool> HandleHttpClient(HttpContext httpClient)
{
var reader = new StreamReader(httpClient.Request.Body);
var requestBody = await reader.ReadToEndAsync();
Expand Down Expand Up @@ -63,6 +63,7 @@ protected override async Task HandleHttpClient(HttpContext httpClient)

await httpClient.Response.Body.WriteAsync(bytes, 0, bytes.Length);
}
return true;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ protected virtual async Task InternalStart(int port)
var app = builder.Build();
app.Use(async (context, next) =>
{
await HandleHttpClient(context);
await next(context);
if (!await HandleHttpClient(context))
await next(context);
});
await Task.WhenAny(app.RunAsync(null), Task.Delay(3000));
}
Expand All @@ -92,7 +92,7 @@ protected virtual async Task InternalStart(int port)
/// </summary>
/// <param name="httpClient"></param>
/// <returns></returns>
protected abstract Task HandleHttpClient(HttpContext httpClient);
protected abstract Task<bool> HandleHttpClient(HttpContext httpClient);

string _lastResponseBody = "";
/// <summary>
Expand Down

0 comments on commit 14fd122

Please sign in to comment.