Skip to content

Commit 0fd1c1e

Browse files
committed
HttpListener fix 404 response
1 parent 81cfa75 commit 0fd1c1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Prometheus.Client.MetricServer/MetricServer.HttpListener.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private void StartListen()
133133

134134
if (request.RawUrl.TrimEnd('/') == _mapPath)
135135
{
136+
response.StatusCode = 200;
136137
response.ContentType = Defaults.ContentType;
137138
using (var outputStream = response.OutputStream)
138139
{
@@ -142,6 +143,9 @@ private void StartListen()
142143
else
143144
{
144145
response.StatusCode = 404;
146+
using (var outputStream = response.OutputStream)
147+
{
148+
}
145149
}
146150
}
147151

0 commit comments

Comments
 (0)