Skip to content

Commit

Permalink
fix copy out
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli committed Sep 9, 2020
1 parent 8cafbc1 commit ad65fc8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package main

import (
"context"
"io/ioutil"
"log"
"net/http"

"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stdcopy"
)

func checkAccessKey(r *http.Request) bool {
Expand Down Expand Up @@ -46,15 +46,9 @@ func supervisorLogs(w http.ResponseWriter, r *http.Request) {
}
defer reader.Close()

//read the first 8 bytes to ignore the HEADER part from docker container logs
p := make([]byte, 8)
reader.Read(p)

// Return the content
content, _ := ioutil.ReadAll(reader)

w.Header().Add("Content-Type", "text/plain")
w.Write(content)
stdcopy.StdCopy(w, w, reader)
}

func supervisorRestart(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit ad65fc8

Please sign in to comment.