UTF-8 filenames not properly encoded in content disposition header
Downloading files from a browser (Chrome and Edge but not Safari) will fail and give the error net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
when the filename is a combination of UTF-8 characters and commas.
Example test: downloading a file named: あ,い
. The japanese characters are encoded but the comma is not, the following string is the header sent to the browser:
filename*=UTF-8''%E3%81%82,%E3%81%84
The source of this issue seems to be from commit: 737eef09 which replaces the function soup_uri_encode with g_uri_escape_string. Both of these functions take a list of characters but the original function used that list as extra reserved characters to encode, the new function uses that list as characters which should not be encoded. The characters in question are "*'%()<>@,;:\\\"/[]?="
.
Reference RFC: https://datatracker.ietf.org/doc/html/rfc5987