Skip to content

Commit 2256a80

Browse files
sechunOHshawnallen85
authored andcommitted
Fix response order (#29)
1 parent 0eb341f commit 2256a80

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ await httpContext.Response.WriteError(ex.Message
155155

156156
Initialized = true;
157157

158-
await httpContext.Response.WriteResponse(200, "OK");
159-
160158
AwaitableMethod = (Method.ReturnType.GetMethod(nameof(Task.GetAwaiter)) != null);
161159

162160
return (new Run(Type, Method, Constructor, AwaitableMethod));

core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public void Configure(IApplicationBuilder app)
4343
if (httpContext.Request.Path.Equals(initPath))
4444
{
4545
run = await init.HandleRequest(httpContext);
46+
47+
if (run != null)
48+
await httpContext.Response.WriteResponse(200, "OK");
49+
4650
return;
4751
}
4852

core/dotnet3.0/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ await httpContext.Response.WriteError(ex.Message
155155

156156
Initialized = true;
157157

158-
await httpContext.Response.WriteResponse(200, "OK");
159-
160158
AwaitableMethod = (Method.ReturnType.GetMethod(nameof(Task.GetAwaiter)) != null);
161159

162160
return (new Run(Type, Method, Constructor, AwaitableMethod));

core/dotnet3.0/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public void Configure(IApplicationBuilder app)
4343
if (httpContext.Request.Path.Equals(initPath))
4444
{
4545
run = await init.HandleRequest(httpContext);
46+
47+
if (run != null)
48+
await httpContext.Response.WriteResponse(200, "OK");
49+
4650
return;
4751
}
4852

0 commit comments

Comments
 (0)