Pārlūkot izejas kodu

Fix Content-Length for prettified responses

Lu Stadler 7 gadi atpakaļ
vecāks
revīzija
b293d807bd
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      go/fake-http/fake-http.go

+ 1 - 0
go/fake-http/fake-http.go

@ -69,6 +69,7 @@ func main() {
69 69
			if err != nil {
70 70
				log.Printf("Error: Prettyfying JSON: %s", err)
71 71
			} else {
72
				resp.Header.Set("Content-Length", fmt.Sprintf("%d", len(pretty)))
72 73
				resp.Body = ioutil.NopCloser(bytes.NewReader(pretty))
73 74
			}
74 75
		}