Skip to content

Commit 9aa7572

Browse files
committed
Fixing the host check timeout and middleware registration order
1 parent 28e2fbe commit 9aa7572

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/WebJobs.Script.WebHost/Middleware/ScriptHostCheckMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task Invoke(HttpContext httpContext, WebScriptHostManager manager)
3030

3131
if (!bypassHostCheck)
3232
{
33-
bool hostReady = await manager.DelayUntilHostReady(timeoutSeconds: 5);
33+
bool hostReady = await manager.DelayUntilHostReady();
3434

3535
if (!hostReady)
3636
{

src/WebJobs.Script.WebHost/WebJobsApplicationBuilderExtension.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ public static IApplicationBuilder UseWebJobsScriptHost(this IApplicationBuilder
1919
public static IApplicationBuilder UseWebJobsScriptHost(this IApplicationBuilder builder, IApplicationLifetime applicationLifetime, Action<WebJobsRouteBuilder> routes)
2020
{
2121
builder.UseMiddleware<FunctionInvocationMiddleware>();
22-
builder.UseHttpBindingRouting(applicationLifetime, routes);
2322
builder.UseWhen(context => !context.Request.Path.StartsWithSegments("/admin/host/status"), config =>
2423
{
2524
config.UseMiddleware<ScriptHostCheckMiddleware>();
2625
});
2726

27+
// Ensure the HTTP binding routing is registered after all middleware
28+
builder.UseHttpBindingRouting(applicationLifetime, routes);
29+
2830
builder.UseMvc(r =>
2931
{
3032
r.MapRoute(name: "Home",

0 commit comments

Comments
 (0)