Sfoglia il codice sorgente

Fix Content-Length for prettified responses

Lu Stadler 7 anni fa
parent
commit
b293d807bd
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  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
		}