From a7a9d7d85c60f0b46c383da6d4c2d8738adfabb9 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 2 Feb 2016 12:40:42 +0100 Subject: [PATCH] Return correct content type for /rest/events --- cmd/syncthing/gui.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index de415043..79f6585d 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -893,8 +893,10 @@ func (s *apiService) getEvents(w http.ResponseWriter, r *http.Request) { s.fss.gotEventRequest() - // Flush before blocking, to indicate that we've received the request - // and that it should not be retried. + // Flush before blocking, to indicate that we've received the request and + // that it should not be retried. Must set Content-Type header before + // flushing. + w.Header().Set("Content-Type", "application/json; charset=utf-8") f := w.(http.Flusher) f.Flush()