[mimetic-users] content-disposition filename parameter parsing issue
Brought to you by:
tat0o
|
From: 김대성 <ad9...@gm...> - 2015-11-02 06:27:10
|
Dear, mimetic users
In current version of mimetic,content-disposition parameters are split with
';' character.
If there is semicolon in quoted parameter string, it split too.
But this is bad parsing cause of rfc2183, rfc2045
[RFC2183 2]
disposition-parm := filename-parm
/ creation-date-parm
/ modification-date-parm
/ read-date-parm
/ size-parm
/ parameter
filename-parm := "filename" "=" value
[RFC2045 5.1]
value := token / quoted-string
token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
or tspecials>
tspecials := "(" / ")" / "<" / ">" / "@" /
"," / ";" / ":" / "\" / <">
"/" / "[" / "]" / "?" / "="
; Must be in quoted-string,
; to use within parameter values
I think string tokenizer can fix this problem easily. But tokenizer just
split string with delimiter. It does not consider delimiter is in double
quote.(How do you this about making parameter scanner?) So I fixed
contentdisposition and contenttype classes.
please check my code.
regards
|