playframework/playframework — pull request #2175 by jroper (2013-12-17 03:08:04+00:00)
Title: Ok.chunked is  *not* ignoring empty blocks

We recently faced this issue when streaming file contents as Ok.Chunked. The contents of the file is split into multiple Enumerators and all these enumerators are chained together. If any of the enumerator in the chain ends up with an empty contents Ok.chunked terminates the connection.It would be nice if Ok.chunked could only do that when it reaches EOF.

```def index = Action {
Ok.chunked(
Enumerator("some lines" * 100)
.andThen(Enumerator(""))
.andThen(Enumerator("some more lines" * 100))
)
}```

Right now I am using Enumeratee.filter to fix this issue but the current behavior did took me and @brikis98 as surprise.