Closed eriadam closed 2 years ago
Hi @eriadam
Your PR as it is now it breaks a bunch of tests. The problem is the pattern you are using only selects word characters while boundaries can include all sorts of non white space characters. I think the correct regex pattern would be "boundary=(\S*)"
instead.
Also for completeness it would be nice if you would include a test case.
Thanks!
Hi @ademar, thanks, yes, I've seen, I will look into it in the evening.
Hi @ademar , I updated the solution, please have a look if it is OK like this. Cheers
It looks great, thanks very much. I'll push a new nuget version with these changes tomorrow.
As detailed in the issue #759, the current parsing of the boundary does not respect the
charset
property.The PR proposes a fix to use a regular expression to parse the boundary from the ContentType header value based on RFC2046. It allows alphanumeric characters, punctuations and spaces (except at the end). Quotation marks seem to be optional as well.
Changed for
"multipart/form-data"
and"multipart/mixed"
in the code.Input:
Original result:
New results: