Skip to content

Commit

Permalink
Update regex to require an end quote
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored Nov 20, 2023
1 parent 5b356a1 commit 4181d23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/parse-body.R
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ parser_multi <- function() {
if (!stri_detect_fixed(content_type, "boundary=", case_insensitive = TRUE))
stop("No boundary found in multipart content-type header: ", content_type)
boundary <- stri_match_first_regex(content_type, "boundary=([^; ]{2,})", case_insensitive = TRUE)[,2]
boundary <- stri_replace_first_regex(boundary, '^"([^"]+)"?', "$1")
# Remove surrounding quotes if they exist
boundary <- stri_replace_first_regex(boundary, '^"([^"]+)"$', "$1")
toparse <- parse_multipart(value, boundary)

# set the names of the items as the `name` of each item
Expand Down

0 comments on commit 4181d23

Please sign in to comment.