don't unquote keys in mime.multipart

db4
U-C4\Administrator 2009-01-20 13:23:58 -06:00
parent 94a72d3915
commit 0309f66252
2 changed files with 2 additions and 16 deletions

View File

@ -20,10 +20,10 @@ IN: mime.multipart.tests
[ t ] [
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
drop "up.txt" swap key?
drop "\"up.txt\"" swap key?
] unit-test
[ t ] [
mime-test-stream [ upload-separator parse-multipart ] with-input-stream
nip "text1" swap key?
nip "\"text1\"" swap key?
] unit-test

View File

@ -76,20 +76,7 @@ ERROR: end-of-stream multipart ;
parse-headers >hashtable >>header
] 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 -- )
[ unquote ] change-filename
dup filename>> empty? [
drop
] [
@ -99,7 +86,6 @@ ERROR: end-of-stream multipart ;
] if ;
: save-form-variable ( multipart -- )
[ unquote ] change-name
[ [ header>> ] [ name>> ] [ name-content>> ] tri mime-variable boa ]
[ name>> ]
[ form-variables>> set-at ] tri ;