don't unquote keys in mime.multipart
parent
94a72d3915
commit
0309f66252
|
@ -20,10 +20,10 @@ IN: mime.multipart.tests
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
|
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
|
||||||
drop "up.txt" swap key?
|
drop "\"up.txt\"" swap key?
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
|
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
|
||||||
nip "text1" swap key?
|
nip "\"text1\"" swap key?
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -76,20 +76,7 @@ ERROR: end-of-stream multipart ;
|
||||||
parse-headers >hashtable >>header
|
parse-headers >hashtable >>header
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: quote? ( ch -- ? ) "'\"" member? ;
|
|
||||||
|
|
||||||
: quoted? ( str -- ? )
|
|
||||||
{
|
|
||||||
[ length 1 > ]
|
|
||||||
[ first quote? ]
|
|
||||||
[ [ first ] [ peek ] bi = ]
|
|
||||||
} 1&& ;
|
|
||||||
|
|
||||||
: unquote ( string -- string' )
|
|
||||||
dup quoted? [ but-last-slice rest-slice >string ] when ;
|
|
||||||
|
|
||||||
: save-uploaded-file ( multipart -- )
|
: save-uploaded-file ( multipart -- )
|
||||||
[ unquote ] change-filename
|
|
||||||
dup filename>> empty? [
|
dup filename>> empty? [
|
||||||
drop
|
drop
|
||||||
] [
|
] [
|
||||||
|
@ -99,7 +86,6 @@ ERROR: end-of-stream multipart ;
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: save-form-variable ( multipart -- )
|
: save-form-variable ( multipart -- )
|
||||||
[ unquote ] change-name
|
|
||||||
[ [ header>> ] [ name>> ] [ name-content>> ] tri mime-variable boa ]
|
[ [ header>> ] [ name>> ] [ name-content>> ] tri mime-variable boa ]
|
||||||
[ name>> ]
|
[ name>> ]
|
||||||
[ form-variables>> set-at ] tri ;
|
[ form-variables>> set-at ] tri ;
|
||||||
|
|
Loading…
Reference in New Issue