egg 3.28.0 → 3.29.0

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/History.md ADDED
@@ -0,0 +1,52 @@
1
+
2
+ 3.29.0 / 2024-11-30
3
+ ==================
4
+
5
+ **features**
6
+ * [[`e4f706990`](http://github.com/eggjs/egg/commit/e4f7069904b99c842e65692f2531a72543719207)] - feat: use urllib@4.5.0 (#5371) (fengmk2 <<fengmk2@gmail.com>>)
7
+
8
+ 3.28.0 / 2024-09-16
9
+ ==================
10
+
11
+ **features**
12
+ * [[`46d3fb222`](http://github.com/eggjs/egg/commit/46d3fb222bcf455d2aee9a99005d18c271f29b16)] - feat: support allowH2 on urllib@4 (#5357) (fengmk2 <<suqian.yf@antgroup.com>>)
13
+
14
+ 3.27.1 / 2024-07-12
15
+ ==================
16
+
17
+ **fixes**
18
+ * [[`f3d8df1b`](http://github.com/eggjs/egg/commit/f3d8df1b7c2aef88cca3beec8c753656f8cc629c)] - fix: add httpclient.safeCurl typing (#5341) (killa <<zhubin.gzb@antgroup.com>>)
19
+
20
+ 3.27.0 / 2024-07-12
21
+ ==================
22
+
23
+ **features**
24
+ * [[`68cbd241`](http://github.com/eggjs/egg/commit/68cbd241e2172b8018328d77ea087dd5974a580f)] - feat: impl httpclient.safeCurl (#5339) (killa <<zhubin.gzb@antgroup.com>>)
25
+
26
+ 3.26.1 / 2024-07-04
27
+ ==================
28
+
29
+ **fixes**
30
+ * [[`872273cb`](http://github.com/eggjs/egg/commit/872273cb23cd6f5d76b3f33528916effade31011)] - fix: xframe value type (#5336) (hongzzz <<hongzzz@foxmail.com>>)
31
+
32
+ **others**
33
+ * [[`8ae76d09`](http://github.com/eggjs/egg/commit/8ae76d09db8cf020cbdacfc64fee0750b9612136)] - docs: fix typo (#5330) (Fu Yuchen <<78291982+fyc09@users.noreply.github.com>>)
34
+
35
+ 3.26.0 / 2024-07-01
36
+ ==================
37
+
38
+ **features**
39
+ * [[`b0292a8b`](http://github.com/eggjs/egg/commit/b0292a8b7e76d5dbf7441b7164c39441dbae51ec)] - feat: allow to create httpClient from app (#5334) (fengmk2 <<suqian.yf@antgroup.com>>)
40
+
41
+ 3.25.0 / 2024-06-27
42
+ ==================
43
+
44
+ **features**
45
+ * [[`ceded0b1`](http://github.com/eggjs/egg/commit/ceded0b1c9217503c5ed9226f96c493d6bd00547)] - feat: allow to httpClient use HTTP2 first (#5332) (fengmk2 <<suqian.yf@antgroup.com>>)
46
+
47
+ **others**
48
+ * [[`8553c3f2`](http://github.com/eggjs/egg/commit/8553c3f23e423e9f60144b11a484b703fe7c9229)] - chore: remove auto release (fengmk2 <<suqian.yf@antgroup.com>>)
49
+ * [[`b4f01a1c`](http://github.com/eggjs/egg/commit/b4f01a1c6bf006c943c85fce334b81d61f55b7d0)] - chore: fix release branches name (fengmk2 <<suqian.yf@antgroup.com>>)
50
+ * [[`a8073b04`](http://github.com/eggjs/egg/commit/a8073b04fc3821bb23326c6c8b4fd0ccaeb5c200)] - chore: add release config (fengmk2 <<suqian.yf@antgroup.com>>)
51
+ * [[`8ce2ff90`](http://github.com/eggjs/egg/commit/8ce2ff90bfbb9e4580a23ea49a15fdb1c185fbb5)] - chore: add npm publish tag (fengmk2 <<suqian.yf@antgroup.com>>)
52
+ * [[`44950ed8`](http://github.com/eggjs/egg/commit/44950ed82a3ce4d5d4b9028aee98d6650298a552)] - chore: start 3.x LTS (fengmk2 <<suqian.yf@antgroup.com>>)
@@ -1,3 +1,4 @@
1
+ const debug = require('util').debuglog('egg:lib:core:httpclient_next');
1
2
  const ms = require('humanize-ms');
2
3
 
3
4
  const SSRF_HTTPCLIENT = Symbol('SSRF_HTTPCLIENT');
@@ -6,9 +7,17 @@ const mainNodejsVersion = parseInt(process.versions.node.split('.')[0]);
6
7
  let HttpClient;
7
8
  if (mainNodejsVersion >= 18) {
8
9
  // urllib@4 only works on Node.js >= 18
9
- HttpClient = require('urllib4').HttpClient;
10
- } else {
10
+ try {
11
+ HttpClient = require('urllib4').HttpClient;
12
+ debug('urllib4 enable');
13
+ } catch (err) {
14
+ debug('require urllib4 error: %s', err);
15
+ }
16
+ }
17
+ if (!HttpClient) {
18
+ // fallback to urllib@3
11
19
  HttpClient = require('urllib-next').HttpClient;
20
+ debug('urllib3 enable');
12
21
  }
13
22
 
14
23
  class HttpClientNext extends HttpClient {
@@ -26,6 +35,7 @@ class HttpClientNext extends HttpClient {
26
35
  // use on egg-security ssrf
27
36
  // https://github.com/eggjs/egg-security/blob/master/lib/extend/safe_curl.js#L11
28
37
  checkAddress: options.checkAddress,
38
+ connect: options.connect,
29
39
  });
30
40
  this.app = app;
31
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.28.0",
3
+ "version": "3.29.0",
4
4
  "publishConfig": {
5
5
  "tag": "release-3.x",
6
6
  "access": "public"
@@ -56,7 +56,7 @@
56
56
  "sendmessage": "^2.0.0",
57
57
  "urllib": "^2.33.0",
58
58
  "urllib-next": "npm:urllib@^3.27.1",
59
- "urllib4": "npm:urllib@^4.3.0",
59
+ "urllib4": "npm:urllib@^4.5.0",
60
60
  "utility": "^2.1.0",
61
61
  "ylru": "^1.3.2"
62
62
  },
@@ -79,6 +79,7 @@
79
79
  "eslint": "^8.23.1",
80
80
  "eslint-config-egg": "^12.0.0",
81
81
  "formstream": "^1.1.1",
82
+ "https-pem": "^3.0.0",
82
83
  "jsdoc": "^3.6.11",
83
84
  "koa": "^2.13.4",
84
85
  "koa-static": "^5.0.0",