-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add final boundary for multipart entities with no parts #1257 #1260
Conversation
Can one of the repo owners verify this patch? |
OK TO TEST |
Test PASSed. |
I signed the Lightbend CLA, |
Hi, @arnohaase, thanks for the contribution. The change seems reasonable, though it is unclear to me if multipart entities without any part would (or should) be allowed at all? Do have any reference for that? |
The spec does not specifically forbid it, at least as far as I can see. But it does specify that the final boundary must always be present. https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html The problem appeared in a real-world problem where a multipart response was used to represent documents matching a search, with "no parts" being a valid response document. Btw, MultipartUnmarshallers.defaultMultipartGeneralUnmarshaller can handle Multipart entities without entries already, provided the final boundary is present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, especially since the change is only in strict
and it looks like it already behaved that way for streamed
.
It'd be nice to have an easy way to execute the test both in 'strict' and 'streamed' mode, do we have a way to do that?
It says:
I understand it that "one or more" wouldn't include zero. But I guess that's only a nitpick. I agree we should do it consistently for marshallers and unmarshallers and also for strict and streamed. Would be nice to have tests being run for strict and streamed variants. Is that something you would like to work on, @arnohaase or @raboof? |
Yep, sounds good. |
Fixes #1257