Skip to content

Commit

Permalink
Maintain default delimiter of newline
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jacksontj authored and achew22 committed Dec 8, 2017
1 parent a92d37f commit cde2f8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cde2f8f

Please sign in to comment.