formstream 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/lib/formstream.js +3 -9
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -204,14 +204,8 @@ See [Node.js Documentation](http://nodejs.org/api/stream.html#stream_event_end)
|
|
|
204
204
|
|
|
205
205
|
[MIT](LICENSE)
|
|
206
206
|
|
|
207
|
-
<!-- GITCONTRIBUTOR_START -->
|
|
208
|
-
|
|
209
207
|
## Contributors
|
|
210
208
|
|
|
211
|
-
|
|
212
|
-
| :---: | :---: | :---: | :---: | :---: | :---: |
|
|
213
|
-
[<img src="https://avatars.githubusercontent.com/u/7326406?v=4" width="100px;"/><br/><sub><b>shaozj</b></sub>](https://github.com/shaozj)<br/>
|
|
214
|
-
|
|
215
|
-
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Wed May 15 2024 00:34:12 GMT+0800`.
|
|
209
|
+
[](https://github.com/node-modules/formstream/graphs/contributors)
|
|
216
210
|
|
|
217
|
-
|
|
211
|
+
Made with [contributors-img](https://contrib.rocks).
|
package/lib/formstream.js
CHANGED
|
@@ -35,6 +35,7 @@ Content-Type: image/png\r\n
|
|
|
35
35
|
|
|
36
36
|
var debug = require('util').debuglog('formstream');
|
|
37
37
|
var Stream = require('stream');
|
|
38
|
+
var crypto = require('crypto');
|
|
38
39
|
var parseStream = require('pause-stream');
|
|
39
40
|
var util = require('util');
|
|
40
41
|
var mime = require('mime');
|
|
@@ -71,15 +72,8 @@ util.inherits(FormStream, Stream);
|
|
|
71
72
|
module.exports = FormStream;
|
|
72
73
|
|
|
73
74
|
FormStream.prototype._generateBoundary = function() {
|
|
74
|
-
// https://github.com/
|
|
75
|
-
|
|
76
|
-
// They are optimized for boyer-moore parsing.
|
|
77
|
-
var boundary = '--------------------------';
|
|
78
|
-
for (var i = 0; i < 24; i++) {
|
|
79
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return boundary;
|
|
75
|
+
// https://github.com/form-data/form-data/blob/16e00765342106876f98a1c9703314006c9e937a/lib/form_data.js#L345
|
|
76
|
+
return '--------------------------' + crypto.randomBytes(12).toString('hex');
|
|
83
77
|
};
|
|
84
78
|
|
|
85
79
|
FormStream.prototype.setTotalStreamSize = function (size) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formstream",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "A multipart/form-data encoded stream, helper for file upload.",
|
|
5
5
|
"main": "lib/formstream.js",
|
|
6
6
|
"types": "types/formstream.d.ts",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"cov": "egg-bin cov",
|
|
14
14
|
"ci": "npm run lint && npm run tsd && npm run cov && NODE_DEBUG=formstream npm run cov",
|
|
15
15
|
"lint": "jshint .",
|
|
16
|
-
"tsd": "tsd"
|
|
17
|
-
"contributor": "git-contributor"
|
|
16
|
+
"tsd": "tsd"
|
|
18
17
|
},
|
|
19
18
|
"repository": {
|
|
20
19
|
"type": "git",
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
"connect-multiparty": "1",
|
|
41
40
|
"egg-bin": "^5.6.1",
|
|
42
41
|
"express": "^4.16.4",
|
|
43
|
-
"git-contributor": "^2.1.5",
|
|
44
42
|
"jshint": "^2.13.6",
|
|
45
43
|
"pedding": "1",
|
|
46
44
|
"should": "4",
|