You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But ContentDispositionHeader.ParseParameter() does not handle escape characters, so it does not work:
private KeyValuePair<string,string> ParseParameter(string fragment)
{
var equalIndex = fragment.IndexOf('=');
if (equalIndex == -1)
throw new FormatException();
var key = fragment.Substring(0, equalIndex).Trim();
var beginningValue = fragment.IndexOf('"',equalIndex+1);
if (beginningValue == -1)
throw new FormatException();
var endValue = fragment.IndexOf('"',beginningValue+1);
if (endValue == -1)
throw new FormatException();
return new KeyValuePair<string, string>(key, fragment.Substring(beginningValue+1, endValue-beginningValue-1));
}
Need to port over the tests from sina in the OR codebase, as sina itself never quite got implemented. For reference, test cases are here: http://test.greenbytes.de/tech/tc2231/
I was trying to pass a filename containing quotes like this:
But
ContentDispositionHeader.ParseParameter()
does not handle escape characters, so it does not work:I am not absolute sure about the validity, but as I read the RFC's then Content-Disposition filename is a quoted-string as described in https://tools.ietf.org/html/rfc2616#section-2.2 (see also https://tools.ietf.org/html/rfc6266#section-4.3)
The text was updated successfully, but these errors were encountered: