summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod/containers_stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/libpod/containers_stats.go')
-rw-r--r--pkg/api/handlers/libpod/containers_stats.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/api/handlers/libpod/containers_stats.go b/pkg/api/handlers/libpod/containers_stats.go
index 8a04884b0..084f1252d 100644
--- a/pkg/api/handlers/libpod/containers_stats.go
+++ b/pkg/api/handlers/libpod/containers_stats.go
@@ -6,6 +6,7 @@ import (
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
+ api "github.com/containers/podman/v3/pkg/api/types"
"github.com/containers/podman/v3/pkg/cgroups"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/domain/infra/abi"
@@ -16,8 +17,8 @@ import (
)
func StatsContainer(w http.ResponseWriter, r *http.Request) {
- runtime := r.Context().Value("runtime").(*libpod.Runtime)
- decoder := r.Context().Value("decoder").(*schema.Decoder)
+ runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
+ decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder)
// Check if service is running rootless (cheap check)
if rootless.IsRootless() {
@@ -60,7 +61,7 @@ func StatsContainer(w http.ResponseWriter, r *http.Request) {
// Write header and content type.
w.WriteHeader(http.StatusOK)
- w.Header().Add("Content-Type", "application/json")
+ w.Header().Set("Content-Type", "application/json")
if flusher, ok := w.(http.Flusher); ok {
flusher.Flush()
}