Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: felixge/node-formidable
base: v0.9.6
...
head fork: felixge/node-formidable
compare: v0.9.7
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
6 Readme.md
View
@@ -85,7 +85,7 @@ If you want the files written to `incomingForm.uploadDir` to include the extensi
Either 'multipart' or 'urlencoded' depending on the incoming request.
-#### incomingForm.maxFieldSize = 2 * 1024 * 1024
+#### incomingForm.maxFieldsSize = 2 * 1024 * 1024
Limits the amount of memory a field (not file) can allocate in bytes.
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
Formidable is licensed under the MIT license.
+## Ports
+
+* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable
+
## Credits
* [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
View
@@ -14,7 +14,7 @@ function IncomingForm() {
this.error = null;
this.ended = false;
- this.maxFieldSize = 2 * 1024 * 1024;
+ this.maxFieldsSize = 2 * 1024 * 1024;
this.keepExtensions = false;
this.uploadDir = '/tmp';
this.encoding = 'utf-8';
@@ -149,8 +149,8 @@ IncomingForm.prototype.handlePart = function(part) {
part.addListener('data', function(buffer) {
self._fieldsSize += buffer.length;
- if (self._fieldsSize > self.maxFieldSize) {
- self._error(new Error('maxFieldSize exceeded, received '+self._fieldsSize+' bytes of field data'));
+ if (self._fieldsSize > self.maxFieldsSize) {
+ self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data'));
return;
}
value += decoder.write(buffer);
2  package.json
View
@@ -1,5 +1,5 @@
{ "name" : "formidable"
-, "version": "0.9.6"
+, "version": "0.9.7"
, "dependencies": {"gently": ">=0.7.0"}
, "directories" : { "lib" : "./lib/formidable" }
, "main" : "./lib/formidable/index"
6 test/simple/test-incoming-form.js
View
@@ -31,7 +31,7 @@ test(function constructor() {
assert.strictEqual(form.encoding, 'utf-8');
assert.strictEqual(form.bytesReceived, null);
assert.strictEqual(form.bytesExpected, null);
- assert.strictEqual(form.maxFieldSize, 2 * 1024 * 1024);
+ assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024);
assert.strictEqual(form._parser, null);
assert.strictEqual(form._flushing, 0);
assert.strictEqual(form._fieldsSize, 0);
@@ -553,12 +553,12 @@ test(function handlePart() {
})();
(function testFieldSize() {
- form.maxFieldSize = 8;
+ form.maxFieldsSize = 8;
var PART = new events.EventEmitter();
PART.name = 'my_field';
gently.expect(form, '_error', function(err) {
- assert.equal(err.message, 'maxFieldSize exceeded, received 9 bytes of field data');
+ assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data');
});
form.handlePart(PART);

No commit comments for this range

Something went wrong with that request. Please try again.