Skip to content
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

Quoted boundaries doesn't work #108

Open
dotMorten opened this issue Jan 16, 2016 · 0 comments
Open

Quoted boundaries doesn't work #108

dotMorten opened this issue Jan 16, 2016 · 0 comments

Comments

@dotMorten
Copy link

When looking for the boundary a multipart request, quoted boundaries doesn't seem to be handled.

const std::string boundary = std::string("--") + content_type.substr(pos+9);

     // parse field boundary 
988     std::size_t pos = content_type.find("boundary="); 
989     if (pos == std::string::npos) 
990         return false; 
991     const std::string boundary = std::string("--") + content_type.substr(pos+9);  

However this is allowed, and for instance used by default by .NET Core's HttpClient:
Here's an example from the RFC: http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

     From: Nathaniel Borenstein <[email protected]> 
     To:  Ned Freed <[email protected]> 
     Subject: Sample message 
     MIME-Version: 1.0 
     Content-type: multipart/mixed; boundary="simple 
     boundary" 

     This is the preamble.  It is to be ignored, though it 
     is a handy place for mail composers to include an 
     explanatory note to non-MIME compliant readers. 
     --simple boundary 

     This is implicitly typed plain ASCII text. 
     It does NOT end with a linebreak. 
     --simple boundary 
     Content-type: text/plain; charset=us-ascii 

     This is explicitly typed plain ASCII text. 
     It DOES end with a linebreak. 

     --simple boundary-- 
     This is the epilogue.  It is also to be ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant