From f95de548a4eafe9602509846d7180d923c0f8d38 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Tue, 24 Jun 2014 21:27:07 +0100 Subject: [PATCH] Fix eventstream --- mailhog/http/api/v1.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mailhog/http/api/v1.go b/mailhog/http/api/v1.go index 400e675..9cb3007 100644 --- a/mailhog/http/api/v1.go +++ b/mailhog/http/api/v1.go @@ -94,14 +94,8 @@ func (apiv1 *APIv1) eventstream(session *http.Session) { apiv1.eventlisteners = append(apiv1.eventlisteners, &EventListener{ session, - session.Response.Chunked(), + session.Response.EventStream(), }) - - session.Response.Headers.Add("Content-Type", "text/event-stream") - session.Response.Headers.Add("Cache-Control", "no-cache") - session.Response.Headers.Add("Connection", "keep-alive") - session.Response.Write([]byte("\n\n")) - session.Response.Send() } func (apiv1 *APIv1) messages(session *http.Session) {