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 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
- |[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/288288?v=4" width="100px;"/><br/><sub><b>xingrz</b></sub>](https://github.com/xingrz)<br/>|[<img src="https://avatars.githubusercontent.com/u/32174276?v=4" width="100px;"/><br/><sub><b>semantic-release-bot</b></sub>](https://github.com/semantic-release-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/13151189?v=4" width="100px;"/><br/><sub><b>fjc0k</b></sub>](https://github.com/fjc0k)<br/>|[<img src="https://avatars.githubusercontent.com/u/18096247?v=4" width="100px;"/><br/><sub><b>mrspeiser</b></sub>](https://github.com/mrspeiser)<br/>|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|
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
+ [![Contributors](https://contrib.rocks/image?repo=node-modules/formstream)](https://github.com/node-modules/formstream/graphs/contributors)
216
210
 
217
- <!-- GITCONTRIBUTOR_END -->
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/felixge/node-form-data/blob/master/lib/form_data.js#L162
75
- // This generates a 50 character boundary similar to those used by Firefox.
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.1",
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",