@modern-js/plugin-koa 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @modern-js/plugin-koa
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9594df3f: fix: allow user to set statusCode 404
8
+ - Updated dependencies [deeaa602]
9
+ - Updated dependencies [54786e58]
10
+ - @modern-js/utils@1.3.2
11
+ - @modern-js/core@1.4.3
12
+
3
13
  ## 1.4.0
4
14
 
5
15
  ### Minor Changes
@@ -94,7 +94,7 @@ export default createPlugin(() => ({
94
94
 
95
95
  if (!ctx.body) {
96
96
  // restore statusCode
97
- if (ctx.res.statusCode === 404) {
97
+ if (ctx.res.statusCode === 404 && !ctx.response._explicitStatus) {
98
98
  ctx.res.statusCode = 200;
99
99
  }
100
100
 
@@ -115,7 +115,7 @@ var _default = (0, _serverCore.createPlugin)(() => ({
115
115
 
116
116
  if (!ctx.body) {
117
117
  // restore statusCode
118
- if (ctx.res.statusCode === 404) {
118
+ if (ctx.res.statusCode === 404 && !ctx.response._explicitStatus) {
119
119
  ctx.res.statusCode = 200;
120
120
  }
121
121
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.0",
14
+ "version": "1.4.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.15.3",
37
37
  "@modern-js/adapter-helpers": "^1.2.1",
38
- "@modern-js/utils": "^1.3.0",
38
+ "@modern-js/utils": "^1.3.2",
39
39
  "formidable": "^1.2.2",
40
40
  "koa-body": "^4.2.0",
41
41
  "koa-router": "^10.0.0",
@@ -54,7 +54,7 @@
54
54
  "typescript": "^4",
55
55
  "@modern-js/bff-runtime": "^1.2.1",
56
56
  "@modern-js/bff-utils": "^1.2.2",
57
- "@modern-js/core": "^1.4.0",
57
+ "@modern-js/core": "^1.4.3",
58
58
  "@modern-js/server-core": "^1.2.2",
59
59
  "@scripts/build": "0.0.0",
60
60
  "jest": "^27",
@@ -67,15 +67,14 @@
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@modern-js/bff-utils": "^1.2.2",
70
- "@modern-js/core": "^1.4.0",
70
+ "@modern-js/core": "^1.4.3",
71
71
  "@modern-js/server-core": "^1.2.2",
72
72
  "@modern-js/bff-runtime": "^1.2.1",
73
73
  "koa": "^2.13.3"
74
74
  },
75
75
  "publishConfig": {
76
76
  "registry": "https://registry.npmjs.org/",
77
- "access": "public",
78
- "types": "./dist/types/index.d.ts"
77
+ "access": "public"
79
78
  },
80
79
  "scripts": {
81
80
  "new": "modern new",