Commit 3673e40b authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

http2/h2demo: flush headers earlier in demo /ECHO handler

It confused somebody who thought things were hanging because they had
expected to see a response before they started streaming data.

Change-Id: If672956efde3756c966b0c88b9c15ed21daeccba
Reviewed-on: https://go-review.googlesource.com/125644Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent a680a1ef
......@@ -160,6 +160,9 @@ func echoCapitalHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, "PUT required.", 400)
return
}
if f, ok := w.(http.Flusher); ok {
f.Flush()
}
io.Copy(flushWriter{w}, capitalizeReader{r.Body})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment