Skip to content

Quoted boundaries doesn't work #108

Description

@dotMorten

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 <nsb@bellcore.com> 
     To:  Ned Freed <ned@innosoft.com> 
     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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions