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
This commit is contained in:
parent
62f5818481
commit
4cd03abefe
1 changed files with 2 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue