use ServeContent for index.html
One advantage is that it sets the Content-Type header correctly. License: MIT Signed-off-by: Etienne Laurin <etienne@atnnn.com>
Etienne Laurin committed
Nov 26, 2015 at 03:08 UTC
a83c3a334f116ceacba37ee3cb37e0e849ec07e3
1 file changed
+1
-3
core/corehttp/gateway_handler.go
+1
-3
@@ -228,9 +228,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
228
defer dr.Close()
229
230
// write to request
231
- if r.Method != "HEAD" {
232
- io.Copy(w, dr)
233
- }
231
+ http.ServeContent(w, r, "index.html", modtime, dr)
232
break
233
}
234