Skip to content

Commit a1df576

Browse files
committed
Fix #1212
1 parent 7fb0254 commit a1df576

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

httplib.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,10 +3752,11 @@ class MultipartFormDataParser {
37523752
bool parse(const char *buf, size_t n, const ContentReceiver &content_callback,
37533753
const MultipartContentHeader &header_callback) {
37543754

3755+
// TODO: support 'filename*'
37553756
static const std::regex re_content_disposition(
3756-
"^Content-Disposition:\\s*form-data;\\s*name=\"(.*?)\"(?:;\\s*filename="
3757-
"\"(.*?)\")?\\s*$",
3757+
R"~(^Content-Disposition:\s*form-data;\s*name="(.*?)"(?:;\s*filename="(.*?)")?(?:;\s*filename\*=\S+)?\s*$)~",
37583758
std::regex_constants::icase);
3759+
37593760
static const std::string dash_ = "--";
37603761
static const std::string crlf_ = "\r\n";
37613762

0 commit comments

Comments
 (0)