Skip to content

Quoted boundary handling for multipart  #527

@tlethanh-sdi

Description

@tlethanh-sdi

Some implementations (ex: Qt framwork) used the quoted boundary for multipart form data. Actually, we need a patch for the set_boundary() function in order to handle the multipart data correctly.
It should be nice if cpp-httplib handles this, as it is a part of the standard.

The reference of the quoted boundary is described here: https://tools.ietf.org/html/rfc2046#section-5.1.1

Here is the patch we used:
`

	void set_boundary(std::string boundary) {

		//Remove double-quote from the input string.
		if( boundary.length() >= 2 && boundary.front() == '"' && boundary.back() == '"' )
		{
			boundary_ = boundary.substr( 1, boundary.size() - 2 );
		}else {
			boundary_ = boundary;
		}
	}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions