Skip to content
This repository
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
6  Readme.md
Source Rendered
@@ -85,7 +85,7 @@ If you want the files written to `incomingForm.uploadDir` to include the extensi
85 85
 
86 86
 Either 'multipart' or 'urlencoded' depending on the incoming request.
87 87
 
88  
-#### incomingForm.maxFieldSize = 2 * 1024 * 1024
  88
+#### incomingForm.maxFieldsSize = 2 * 1024 * 1024
89 89
 
90 90
 Limits the amount of memory a field (not file) can allocate in bytes.
91 91
 I this value is exceeded, an `'error'` event is emitted. The default
@@ -157,6 +157,10 @@ Emitted when the entire request has been received, and all contained files have
157 157
 
158 158
 Formidable is licensed under the MIT license.
159 159
 
  160
+## Ports
  161
+
  162
+* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable
  163
+
160 164
 ## Credits
161 165
 
162 166
 * [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js
6  lib/formidable/incoming_form.js
@@ -14,7 +14,7 @@ function IncomingForm() {
14 14
   this.error = null;
15 15
   this.ended = false;
16 16
 
17  
-  this.maxFieldSize = 2 * 1024 * 1024;
  17
+  this.maxFieldsSize = 2 * 1024 * 1024;
18 18
   this.keepExtensions = false;
19 19
   this.uploadDir = '/tmp';
20 20
   this.encoding = 'utf-8';
@@ -149,8 +149,8 @@ IncomingForm.prototype.handlePart = function(part) {
149 149
 
150 150
     part.addListener('data', function(buffer) {
151 151
       self._fieldsSize += buffer.length;
152  
-      if (self._fieldsSize > self.maxFieldSize) {
153  
-        self._error(new Error('maxFieldSize exceeded, received '+self._fieldsSize+' bytes of field data'));
  152
+      if (self._fieldsSize > self.maxFieldsSize) {
  153
+        self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data'));
154 154
         return;
155 155
       }
156 156
       value += decoder.write(buffer);
2  package.json
... ...
@@ -1,5 +1,5 @@
1 1
 { "name" : "formidable"
2  
-, "version": "0.9.6"
  2
+, "version": "0.9.7"
3 3
 , "dependencies": {"gently": ">=0.7.0"}
4 4
 , "directories" : { "lib" : "./lib/formidable" }
5 5
 , "main" : "./lib/formidable/index"
6  test/simple/test-incoming-form.js
@@ -31,7 +31,7 @@ test(function constructor() {
31 31
   assert.strictEqual(form.encoding, 'utf-8');
32 32
   assert.strictEqual(form.bytesReceived, null);
33 33
   assert.strictEqual(form.bytesExpected, null);
34  
-  assert.strictEqual(form.maxFieldSize, 2 * 1024 * 1024);
  34
+  assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024);
35 35
   assert.strictEqual(form._parser, null);
36 36
   assert.strictEqual(form._flushing, 0);
37 37
   assert.strictEqual(form._fieldsSize, 0);
@@ -553,12 +553,12 @@ test(function handlePart() {
553 553
   })();
554 554
 
555 555
   (function testFieldSize() {
556  
-    form.maxFieldSize = 8;
  556
+    form.maxFieldsSize = 8;
557 557
     var PART = new events.EventEmitter();
558 558
     PART.name = 'my_field';
559 559
 
560 560
     gently.expect(form, '_error', function(err) {
561  
-      assert.equal(err.message, 'maxFieldSize exceeded, received 9 bytes of field data');
  561
+      assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data');
562 562
     });
563 563
 
564 564
     form.handlePart(PART);

No commit comments for this range

Something went wrong with that request. Please try again.