Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs')
-rw-r--r--src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs b/src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs
new file mode 100644
index 0000000000..50cb8c736e
--- /dev/null
+++ b/src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs
@@ -0,0 +1,18 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Diagnostics.HealthChecks;
+
+namespace Microsoft.AspNetCore.Diagnostics.HealthChecks
+{
+ internal static class HealthCheckResponseWriters
+ {
+ public static Task WriteMinimalPlaintext(HttpContext httpContext, HealthReport result)
+ {
+ httpContext.Response.ContentType = "text/plain";
+ return httpContext.Response.WriteAsync(result.Status.ToString());
+ }
+ }
+}