Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: v3 .NET #144

Merged
merged 16 commits into from
Jun 8, 2023
Prev Previous commit
Next Next commit
restrict std override
  • Loading branch information
Meldiron committed Feb 5, 2023
commit 16e196999cffd70ecd253b21bd4083f3ff342772
7 changes: 7 additions & 0 deletions runtimes/dotnet-6.0/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ static async Task<IResult> Execute(HttpRequest Request)
RuntimeResponse ContextResponse = new RuntimeResponse();
RuntimeContext Context = new RuntimeContext(ContextRequest, ContextResponse);

var originalOut = Console.Out;
var originalErr = Console.Error;

var Customstd = new StringBuilder();
var CustomstdWriter = new StringWriter(Customstd);
Console.SetOut(CustomstdWriter);
Expand All @@ -65,6 +68,10 @@ static async Task<IResult> Execute(HttpRequest Request)
Context.Error(e.ToString());
Output = Context.Res.Send("", 500, new Dictionary<string,string>());
}
finally {
Console.SetOut(originalOut);
Console.SetError(originalErr);
}

if(Output == null)
{
Expand Down