diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-15 23:51:01 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-15 23:51:01 +0100 |
commit | 4cd03abefe80c9d7ce97d7dfb488e7ed5a8163c8 (patch) | |
tree | fe3c9334396a0370a522447441db77f05e7fee35 /rc/bin/hpost | |
parent | 62f58184815c2ad3eecf0cc811967f3b0659c00e (diff) | |
download | plan9front-4cd03abefe80c9d7ce97d7dfb488e7ed5a8163c8.tar.xz |
hpost: fix multipart/form variable name mangeling when field value contains newlines
com='MH3U
pic unrelated
' hpost -u ... -m post com:$com
resulted in wrong field name like:
--HJBOUNDARY
Content-Disposition: form-data; name="com pic unrelated"
MH3U
pic unrelated
Diffstat (limited to 'rc/bin/hpost')
-rwxr-xr-x | rc/bin/hpost | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/bin/hpost b/rc/bin/hpost index e47dab878..6ac5b839d 100755 --- a/rc/bin/hpost +++ b/rc/bin/hpost @@ -58,7 +58,7 @@ fn menc { f=$1 cr=`{echo x | tr x \015} for(i in $at){ - k=`{sed 's!:.*$!!' /env/i} + k=`{sed 's!:.*$!!; q' /env/i} echo '--'$"f$"cr echo 'Content-Disposition: form-data; name="'$"k'"'$"cr echo $"cr @@ -66,7 +66,7 @@ fn menc { sed 's!^[^:]+:!!' /env/i } for(i in $af){ - k=`{sed 's!@.*$!!' /env/i} + k=`{sed 's!@.*$!!; q' /env/i} v=`{sed 's!^[^@]+@!!' /env/i} t=`{file -m $v} n=`{basename $v} |