pkg/cors: remove http flush

The code is introduced in 7dce4c8fbb, and
the comments cannot explain the usefulness of the code at all.
release-2.0
Yicheng Qin 2015-01-12 17:59:34 -08:00
parent dc6aef0d02
commit 0015372939
1 changed files with 0 additions and 4 deletions

View File

@ -73,10 +73,6 @@ func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) {
// ServeHTTP adds the correct CORS headers based on the origin and returns immediately
// with a 200 OK if the method is OPTIONS.
func (h *CORSHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// It is important to flush before leaving the goroutine.
// Or it may miss the latest info written.
defer w.(http.Flusher).Flush()
// Write CORS header.
if h.Info.OriginAllowed("*") {
h.addHeader(w, "*")