From 00153729396a3de3205a3027c5a81b3a0f99b009 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Mon, 12 Jan 2015 17:59:34 -0800 Subject: [PATCH] pkg/cors: remove http flush The code is introduced in 7dce4c8fbb0063818cfbd2a8cbbd63e8c8bbce31, and the comments cannot explain the usefulness of the code at all. --- pkg/cors/cors.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/cors/cors.go b/pkg/cors/cors.go index 8f682fe45..308963a0e 100644 --- a/pkg/cors/cors.go +++ b/pkg/cors/cors.go @@ -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, "*")