@abtnode/router-provider 1.16.28-beta-10ca1aad → 1.16.28-next-5a717317

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.
@@ -3,7 +3,7 @@ const url = require('url');
3
3
  const path = require('path');
4
4
  const fs = require('fs-extra');
5
5
  const get = require('lodash/get');
6
- const { joinURL } = require('ufo');
6
+ const joinUrl = require('url-join');
7
7
  const checkDomainMatch = require('@abtnode/util/lib/check-domain-match');
8
8
  const { DEFAULT_IP_DOMAIN_SUFFIX, ROUTING_RULE_TYPES, WELLKNOWN_SERVICE_PATH_PREFIX } = require('@abtnode/constant');
9
9
 
@@ -56,7 +56,7 @@ const createRequestHandler = (id) => (req, res, target) => {
56
56
  const parsed = url.parse(req.url);
57
57
  if (parsed.pathname === rule.prefix) {
58
58
  logger.info('redirect url', { url: req.url, rule });
59
- parsed.pathname = joinURL(rule.prefix, '/');
59
+ parsed.pathname = joinUrl(rule.prefix, '/');
60
60
  res.writeHead(307, { Location: url.format(parsed) });
61
61
  res.end();
62
62
  return { abort: true };
@@ -68,7 +68,7 @@ const createRequestHandler = (id) => (req, res, target) => {
68
68
  } else if (rule.prefix.includes(WELLKNOWN_SERVICE_PATH_PREFIX)) {
69
69
  // do not rewrite for service requests
70
70
  } else {
71
- req.url = joinURL(rule.target, req.url.substr(rule.prefix.length));
71
+ req.url = joinUrl(rule.target, req.url.substr(rule.prefix.length));
72
72
  }
73
73
  if (req.url.startsWith('/') === false) {
74
74
  req.url = `/${req.url}`;
@@ -128,7 +128,7 @@ const sharedResolver = (host, url, req) => {
128
128
 
129
129
  return {
130
130
  id: rule.id,
131
- url: rule.targetPrefix && rule.targetPrefix !== '/' ? joinURL(upstream, rule.targetPrefix) : upstream,
131
+ url: rule.targetPrefix && rule.targetPrefix !== '/' ? joinUrl(upstream, rule.targetPrefix) : upstream,
132
132
  path: '/',
133
133
  opts: {
134
134
  ssl: match ? { key: match.privateKey, cert: match.certificate } : null,
package/lib/util.js CHANGED
@@ -5,7 +5,7 @@ const getPort = require('get-port');
5
5
  const portUsed = require('port-used');
6
6
  const uniq = require('lodash/uniq');
7
7
  const sortBy = require('lodash/sortBy');
8
- const isValidDomain = require('@arcblock/is-valid-domain');
8
+ const isValidDomain = require('is-valid-domain');
9
9
  const checkDomainMatch = require('@abtnode/util/lib/check-domain-match');
10
10
  const normalizePathPrefix = require('@abtnode/util/lib/normalize-path-prefix');
11
11
  const { template404, template502, template5xx, templateWelcome } = require('@abtnode/router-templates');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/router-provider",
3
- "version": "1.16.28-beta-10ca1aad",
3
+ "version": "1.16.28-next-5a717317",
4
4
  "description": "Routing engine implementations for abt node",
5
5
  "author": "polunzh <polunzh@gmail.com>",
6
6
  "homepage": "https://github.com/ArcBlock/blocklet-server#readme",
@@ -32,18 +32,18 @@
32
32
  "url": "https://github.com/ArcBlock/blocklet-server/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@abtnode/constant": "1.16.28-beta-10ca1aad",
36
- "@abtnode/logger": "1.16.28-beta-10ca1aad",
37
- "@abtnode/router-templates": "1.16.28-beta-10ca1aad",
38
- "@abtnode/util": "1.16.28-beta-10ca1aad",
35
+ "@abtnode/constant": "1.16.28-next-5a717317",
36
+ "@abtnode/logger": "1.16.28-next-5a717317",
37
+ "@abtnode/router-templates": "1.16.28-next-5a717317",
38
+ "@abtnode/util": "1.16.28-next-5a717317",
39
39
  "@arcblock/http-proxy": "^1.19.1",
40
- "@arcblock/is-valid-domain": "^1.0.5",
41
- "axios": "^1.7.2",
40
+ "axios": "^0.27.2",
42
41
  "debug": "^4.3.4",
43
42
  "find-process": "^1.4.7",
44
43
  "fkill": "^7.2.1",
45
44
  "fs-extra": "^11.2.0",
46
45
  "get-port": "^5.1.1",
46
+ "is-valid-domain": "^0.1.6",
47
47
  "lodash": "^4.17.21",
48
48
  "lru-cache": "^7.14.0",
49
49
  "nginx-conf": "^1.7.0",
@@ -52,12 +52,12 @@
52
52
  "promise-retry": "^2.0.1",
53
53
  "shelljs": "^0.8.5",
54
54
  "tar": "^6.1.11",
55
- "ufo": "^1.5.3",
55
+ "url-join": "^4.0.1",
56
56
  "valid-url": "^1.0.9"
57
57
  },
58
58
  "devDependencies": {
59
59
  "bluebird": "^3.7.2",
60
60
  "fs-extra": "^11.2.0"
61
61
  },
62
- "gitHead": "ed0958b6b5414ae5a3f4066bdf138a157d046b59"
62
+ "gitHead": "3624967f9549de3a25a87ed6b20f82519ddb4757"
63
63
  }