eclipse-ee4j / eclipse-ee4j/metro-mimepull
MIMEParsingException when MIME boundary has leading dashes
- Dominant language
- Java
- Stars
- 5
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
According to https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html in a multipart message the boundary should have two leading hyphen and two trailing hyphen for the last boundary:
```
Content-type: multipart/mixed; boundary="simple boundary"
This is the preamble. ...
--simple boundary
... some text
--simple boundary--
This is the epilogue. It is also to be ignored.
```
When using Mimepull 1.9.6 up to 1.9.14 within Jersey 2.25.1, it responds on such a message with `org.jvnet.mimepull.MIMEParsingException: Missing start boundary`.
On the other hand, when sending a message with Postman, it will send the message without those extra hyphens:
```
POST /myapi/import HTTP/1.1
Content-Length: 708
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="testdata.csv"
Content-Type: text/csv
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
...
----WebKitFormBoundary7MA4YWxkTrZu0gW
```
This message will go through mimepull without any exception.
Can anyone please confirm, that the implementation is expected to be that way or is this probably a bug?
Contributor guide
Assessment
This issue has not been assessed yet.