From cde2f8f5bef06abdf9d0557f284f072f1cfa9f56 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Thu, 7 Dec 2017 11:15:34 -0800 Subject: [PATCH] Maintain default delimiter of newline With the addition of the delimiter interface users can now override the delimiter in the stream. With this additional interface we want to maintain compatibility-- namely we want to continue using a newline in the event that the marshaler doesn't implement the new interface (for backwards compatibility). Fixes #495 --- runtime/handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/handler.go b/runtime/handler.go index cdf5510d247..1770b85344d 100644 --- a/runtime/handler.go +++ b/runtime/handler.go @@ -41,6 +41,8 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal var delimiter []byte if d, ok := marshaler.(Delimited); ok { delimiter = d.Delimiter() + } else { + delimiter = []byte("\n") } var wroteHeader bool