Change JsonFraming to fail stage if completing within an object #29228
This commit is contained in:
parent
f6ceb4d49a
commit
2f2ee9e67c
3 changed files with 47 additions and 17 deletions
|
|
@ -70,6 +70,9 @@ import akka.util.ByteString
|
|||
|
||||
def isEmpty: Boolean = buffer.isEmpty
|
||||
|
||||
/** `true` if the buffer is in a valid state to end framing. */
|
||||
def canComplete: Boolean = !insideObject
|
||||
|
||||
/**
|
||||
* Attempt to locate next complete JSON object in buffered ByteString and returns `Some(it)` if found.
|
||||
* May throw a [[akka.stream.scaladsl.Framing.FramingException]] if the contained JSON is invalid or max object size is exceeded.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue