summaryrefslogtreecommitdiff
path: root/metrics.go
diff options
context:
space:
mode:
Diffstat (limited to 'metrics.go')
-rw-r--r--metrics.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/metrics.go b/metrics.go
index 325006f..0f8ea03 100644
--- a/metrics.go
+++ b/metrics.go
@@ -3,10 +3,11 @@ package caddy
import (
"net/http"
- "github.com/caddyserver/caddy/v2/internal/metrics"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promauto"
+
+ "github.com/caddyserver/caddy/v2/internal/metrics"
)
// define and register the metrics used in this package.
@@ -66,3 +67,9 @@ func (d *delegator) WriteHeader(code int) {
d.status = code
d.ResponseWriter.WriteHeader(code)
}
+
+// Unwrap returns the underlying ResponseWriter, necessary for
+// http.ResponseController to work correctly.
+func (d *delegator) Unwrap() http.ResponseWriter {
+ return d.ResponseWriter
+}