@innet/server 2.0.0-alpha.32 → 2.0.0-alpha.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innet/server",
3
- "version": "2.0.0-alpha.32",
3
+ "version": "2.0.0-alpha.33",
4
4
  "description": "Create server-side application with innet",
5
5
  "main": "index.js",
6
6
  "module": "index.es6.js",
@@ -44,7 +44,6 @@
44
44
  "cookie": "^0.5.0",
45
45
  "http-proxy": "^1.18.1",
46
46
  "innet": "^2.0.0-alpha.3",
47
- "is-invalid-path": "^1.0.2",
48
47
  "mime": "^3.0.0",
49
48
  "multiparty": "^4.2.3",
50
49
  "openapi-types": "^12.1.3",
@@ -14,8 +14,6 @@ import { Action } from '../../../utils/action/Action.es6.js';
14
14
  import { actionContext } from '../../../hooks/useAction/useAction.es6.js';
15
15
  import { requestHandlerContext } from '../../../hooks/useRequestHandler/useRequestHandler.es6.js';
16
16
 
17
- // eslint-disable-next-line @typescript-eslint/no-var-requires
18
- const isInvalidPath = require('is-invalid-path');
19
17
  const server = () => {
20
18
  var _a, _b, _c;
21
19
  const handler = useNewHandler();
@@ -23,10 +21,10 @@ const server = () => {
23
21
  const { env } = process;
24
22
  let { ssl: { cert = (_a = env.INNET_SSL_CRT) !== null && _a !== void 0 ? _a : 'localhost.crt', key = (_b = env.INNET_SSL_KEY) !== null && _b !== void 0 ? _b : 'localhost.key', } = {}, } = props;
25
23
  try {
26
- if (!isInvalidPath(key)) {
24
+ if (!key.startsWith('-----BEGIN PRIVATE KEY-----')) {
27
25
  key = fs.readFileSync(key).toString();
28
26
  }
29
- if (!isInvalidPath(cert)) {
27
+ if (!cert.startsWith('-----BEGIN CERTIFICATE-----')) {
30
28
  cert = fs.readFileSync(cert).toString();
31
29
  }
32
30
  }
@@ -25,8 +25,6 @@ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
25
25
  var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
26
26
  var http2__default = /*#__PURE__*/_interopDefaultLegacy(http2);
27
27
 
28
- // eslint-disable-next-line @typescript-eslint/no-var-requires
29
- const isInvalidPath = require('is-invalid-path');
30
28
  const server = () => {
31
29
  var _a, _b, _c;
32
30
  const handler = innet.useNewHandler();
@@ -34,10 +32,10 @@ const server = () => {
34
32
  const { env } = process;
35
33
  let { ssl: { cert = (_a = env.INNET_SSL_CRT) !== null && _a !== void 0 ? _a : 'localhost.crt', key = (_b = env.INNET_SSL_KEY) !== null && _b !== void 0 ? _b : 'localhost.key', } = {}, } = props;
36
34
  try {
37
- if (!isInvalidPath(key)) {
35
+ if (!key.startsWith('-----BEGIN PRIVATE KEY-----')) {
38
36
  key = fs__default["default"].readFileSync(key).toString();
39
37
  }
40
- if (!isInvalidPath(cert)) {
38
+ if (!cert.startsWith('-----BEGIN CERTIFICATE-----')) {
41
39
  cert = fs__default["default"].readFileSync(cert).toString();
42
40
  }
43
41
  }