You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is probably the wrong thing to do, since the Source is not just data, but also can include processing steps like a watchTermination after the stream is finished. Some users might attempt to use watchTermination or similar, only to find that their source is silently ignored. Akka HTTP handles this case by throwing an exception for empty streamed bodies.
I think we could just handle empty streamed bodies by consuming the body, and simply document that you probably don't want to have a streamed empty body, since that adds extra stream materialization overhead for no reason. This seems like the least surprising behavior. For strict bodies we can keep the current code.
The text was updated successfully, but these errors were encountered:
Right now the Akka HTTP server ignores empty streamed bodies: https://github.com/playframework/playframework/blob/2.6.x/framework/src/play-akka-http-server/src/main/scala/play/core/server/akkahttp/AkkaModelConversion.scala#L282
I think this is probably the wrong thing to do, since the
Source
is not just data, but also can include processing steps like awatchTermination
after the stream is finished. Some users might attempt to usewatchTermination
or similar, only to find that their source is silently ignored. Akka HTTP handles this case by throwing an exception for empty streamed bodies.I think we could just handle empty streamed bodies by consuming the body, and simply document that you probably don't want to have a streamed empty body, since that adds extra stream materialization overhead for no reason. This seems like the least surprising behavior. For strict bodies we can keep the current code.
The text was updated successfully, but these errors were encountered: