multiparty
Advanced tools
Comparing version 4.1.3 to 4.1.4
@@ -0,1 +1,12 @@ | ||
### 4.1.4 | ||
* Douglas Christopher Wilson: | ||
- Add 8 to Travis CI | ||
- Add 10 to Travis CI | ||
- Enable strict mode | ||
- Use safe-buffer for improved API safety | ||
* Mike Samuel | ||
- Fix file extension filtering stopping on certain whitespace characters | ||
### 4.1.3 | ||
@@ -66,3 +77,3 @@ | ||
* Douglas Christopher Wilson: | ||
- Do not invoke callback after close | ||
- Do not invoke callback after close | ||
- Share callback ending logic between error and close | ||
@@ -69,0 +80,0 @@ |
28
index.js
@@ -0,1 +1,11 @@ | ||
/*! | ||
* multiparty | ||
* Copyright(c) 2013 Felix Geisendörfer | ||
* Copyright(c) 2014 Andrew Kelley | ||
* Copyright(c) 2014 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/ | ||
'use strict' | ||
var stream = require('stream'); | ||
@@ -7,2 +17,3 @@ var util = require('util'); | ||
var os = require('os'); | ||
var Buffer = require('safe-buffer').Buffer | ||
var StringDecoder = require('string_decoder').StringDecoder; | ||
@@ -21,5 +32,4 @@ var fdSlicer = require('fd-slicer'); | ||
var PART_DATA = 9; | ||
var PART_END = 10; | ||
var CLOSE_BOUNDARY = 11; | ||
var END = 12; | ||
var CLOSE_BOUNDARY = 10; | ||
var END = 11; | ||
@@ -36,3 +46,3 @@ var LF = 10; | ||
var CONTENT_TYPE_PARAM_RE = /;\s*([^=]+)=(?:"([^"]+)"|([^;]+))/gi; | ||
var FILE_EXT_RE = /(\.[_\-a-zA-Z0-9]{0,16}).*/; | ||
var FILE_EXT_RE = /(\.[_\-a-zA-Z0-9]{0,16})[\S\s]*/; | ||
var LAST_BOUNDARY_SUFFIX_LEN = 4; // --\r\n | ||
@@ -491,8 +501,8 @@ | ||
case '8bit': | ||
self.partTransferEncoding = 'binary'; | ||
break; | ||
self.partTransferEncoding = 'binary'; | ||
break; | ||
case 'base64': break; | ||
default: | ||
return createError(400, 'unknown transfer-encoding: ' + self.partTransferEncoding); | ||
return createError(400, 'unknown transfer-encoding: ' + self.partTransferEncoding); | ||
} | ||
@@ -742,6 +752,6 @@ | ||
function setUpParser(self, boundary) { | ||
self.boundary = new Buffer(boundary.length + 4); | ||
self.boundary = Buffer.alloc(boundary.length + 4) | ||
self.boundary.write('\r\n--', 0, boundary.length + 4, 'ascii'); | ||
self.boundary.write(boundary, 4, boundary.length, 'ascii'); | ||
self.lookbehind = new Buffer(self.boundary.length + 8); | ||
self.lookbehind = Buffer.alloc(self.boundary.length + 8) | ||
self.state = START; | ||
@@ -748,0 +758,0 @@ self.boundaryChars = {}; |
{ | ||
"name": "multiparty", | ||
"version": "4.1.3", | ||
"description": "multipart/form-data parser which supports streaming", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:pillarjs/multiparty.git" | ||
}, | ||
"version": "4.1.4", | ||
"author": "Andrew Kelley <superjoe30@gmail.com>", | ||
"contributors": [ | ||
"Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
"Felix Geisendörfer <felix@debuggable.com>" | ||
], | ||
"license": "MIT", | ||
"keywords": [ | ||
@@ -16,31 +18,31 @@ "file", | ||
], | ||
"repository": "pillarjs/multiparty", | ||
"dependencies": { | ||
"fd-slicer": "~1.0.1", | ||
"safe-buffer": "5.1.2" | ||
}, | ||
"devDependencies": { | ||
"findit2": "~2.2.3", | ||
"istanbul": "~0.4.3", | ||
"mkdirp": "~0.5.1", | ||
"pend": "~1.2.0", | ||
"rimraf": "~2.5.2", | ||
"superagent": "~0.21.0" | ||
"eslint": "2.13.1", | ||
"findit2": "2.2.3", | ||
"istanbul": "0.4.5", | ||
"mkdirp": "0.5.1", | ||
"pend": "1.2.0", | ||
"rimraf": "2.5.4", | ||
"superagent": "1.8.5" | ||
}, | ||
"files": [ | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"README.md", | ||
"index.js" | ||
], | ||
"engines": { | ||
"node": ">= 0.10" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "node test/test.js", | ||
"test-cov": "istanbul cover test/test.js", | ||
"test-travis": "istanbul cover test/test.js --report lcovonly" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"fd-slicer": "~1.0.1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/pillarjs/multiparty/issues" | ||
}, | ||
"main": "index.js", | ||
"directories": { | ||
"example": "examples", | ||
"test": "test" | ||
}, | ||
"author": "Andrew Kelley <superjoe30@gmail.com>" | ||
} | ||
} |
@@ -1,3 +0,9 @@ | ||
# multiparty [![Build Status](https://travis-ci.org/pillarjs/multiparty.svg?branch=master)](https://travis-ci.org/pillarjs/multiparty) [![Coverage Status](https://img.shields.io/coveralls/pillarjs/multiparty.svg)](https://coveralls.io/r/pillarjs/multiparty) | ||
# multiparty | ||
[![NPM Version][npm-image]][npm-url] | ||
[![NPM Downloads][downloads-image]][downloads-url] | ||
[![Node.js Version][node-version-image]][node-version-url] | ||
[![Build Status][travis-image]][travis-url] | ||
[![Test Coverage][coveralls-image]][coveralls-url] | ||
Parse http requests with content-type `multipart/form-data`, also known as file uploads. | ||
@@ -9,16 +15,8 @@ | ||
### Why the fork? | ||
## Installation | ||
* This module uses the Node.js v0.10 streams properly | ||
* It will not create a temp file for you unless you want it to. | ||
* Counts bytes and does math to help you figure out the `Content-Length` of | ||
the final part. | ||
* You can stream uploads to s3 with | ||
[aws-sdk](https://github.com/aws/aws-sdk-js), for [example](examples/s3.js). | ||
* Less bugs. This code is simpler, has all deprecated functionality removed, | ||
has cleaner tests, and does not try to do anything beyond multipart stream | ||
parsing. | ||
This is a [Node.js](https://nodejs.org/en/) module available through the | ||
[npm registry](https://www.npmjs.com/). Installation is done using the | ||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): | ||
## Installation | ||
``` | ||
@@ -257,1 +255,16 @@ npm install multiparty | ||
* `value` - string field value | ||
## License | ||
[MIT](LICENSE) | ||
[npm-image]: https://img.shields.io/npm/v/multiparty.svg | ||
[npm-url]: https://npmjs.org/package/multiparty | ||
[node-version-image]: https://img.shields.io/node/v/multiparty.svg | ||
[node-version-url]: https://nodejs.org/en/download/ | ||
[travis-image]: https://img.shields.io/travis/pillarjs/multiparty/master.svg | ||
[travis-url]: https://travis-ci.org/pillarjs/multiparty | ||
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/multiparty/master.svg | ||
[coveralls-url]: https://coveralls.io/r/pillarjs/multiparty?branch=master | ||
[downloads-image]: https://img.shields.io/npm/dm/multiparty.svg | ||
[downloads-url]: https://npmjs.org/package/multiparty |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44039
714
269
2
7
5
1
2
+ Addedsafe-buffer@5.1.2
+ Addedsafe-buffer@5.1.2(transitive)