Authored by 姜枫

add form decode

@@ -83,7 +83,7 @@ function formy(ctx, opts) { @@ -83,7 +83,7 @@ function formy(ctx, opts) {
83 var form = new forms.IncomingForm(opts) 83 var form = new forms.IncomingForm(opts)
84 form 84 form
85 .on('end', function() { 85 .on('end', function() {
86 - fields = qs.parse(fieldsArray.join('&')); 86 + fields = qs.parse(fieldsArray.join('&'), {decoder: decodeURIComponent});
87 if (Object.keys(files).length !== 0) { 87 if (Object.keys(files).length !== 0) {
88 fields._files = files; 88 fields._files = files;
89 } 89 }
@@ -103,7 +103,7 @@ function formy(ctx, opts) { @@ -103,7 +103,7 @@ function formy(ctx, opts) {
103 // 103 //
104 // fields[field] = value; 104 // fields[field] = value;
105 // } 105 // }
106 - fieldsArray.push(field + '=' + value); 106 + fieldsArray.push(field + '=' + encodeURIComponent(value));
107 }) 107 })
108 .on('file', function(field, file) { 108 .on('file', function(field, file) {
109 if (files[field]) { 109 if (files[field]) {