This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
filename* is lost when creating the FormFile class #651
Closed
Description
When a multipart form includes a filename using RFC 5987 encoding semantics such as:
filename*=UTF-8''foo-%c3%a4.html
That filename is lost when the FormFile class is created. The issue starts at line 184 in FormFeature.cs:
At this point, contentDisposition.FileName is null, because contentDisposition.FileNameStar contains the value of the filename.
To reproduce this issue in test, send the following request:
POST /Home/formtest HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: __atuvc=34%7C7; permanent=0; _gitlab_session=226ad8a0be43681acf38c2fab9497240; __profilin=p%3Dt; request_method=GET
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------9051914041544843365972754266
Content-Length: 408
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="first part"
this is content of the first part
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="file part"; filename*=UTF-8''foo-%c3%a4.html
Content-Type: text/plain
This is content of the file.
-----------------------------9051914041544843365972754266--