@arcblock/crawler-middleware 1.1.3 → 1.1.4

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/lib/cjs/index.js CHANGED
@@ -19,7 +19,7 @@ function getFullUrl(req) {
19
19
  const blockletPathname = req.headers['x-path-prefix']
20
20
  ? (0, ufo_1.joinURL)(req.headers['x-path-prefix'], req.originalUrl)
21
21
  : req.originalUrl;
22
- return (0, ufo_1.joinURL)(env_1.env.appUrl || req.get('host'), blockletPathname);
22
+ return (0, ufo_1.joinURL)(env_1.env.appUrl || req.get('host'), blockletPathname == null || blockletPathname === 'undefined' ? '/' : blockletPathname);
23
23
  }
24
24
  function createSnapshotMiddleware({ endpoint, accessKey, cacheMax = 500, updateInterval = 1000 * 60 * 60 * 24, failedUpdateInterval = 1000 * 60 * 60 * 24, updatedConcurrency = 10, autoReturnHtml = true, allowCrawler = () => true, }) {
25
25
  if (!accessKey || !endpoint) {
package/lib/esm/index.js CHANGED
@@ -16,7 +16,7 @@ function getFullUrl(req) {
16
16
  const blockletPathname = req.headers['x-path-prefix']
17
17
  ? joinURL(req.headers['x-path-prefix'], req.originalUrl)
18
18
  : req.originalUrl;
19
- return joinURL(env.appUrl || req.get('host'), blockletPathname);
19
+ return joinURL(env.appUrl || req.get('host'), blockletPathname == null || blockletPathname === 'undefined' ? '/' : blockletPathname);
20
20
  }
21
21
  export function createSnapshotMiddleware({ endpoint, accessKey, cacheMax = 500, updateInterval = 1000 * 60 * 60 * 24, failedUpdateInterval = 1000 * 60 * 60 * 24, updatedConcurrency = 10, autoReturnHtml = true, allowCrawler = () => true, }) {
22
22
  if (!accessKey || !endpoint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/crawler-middleware",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "lib/cjs/index.js",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/cjs/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "queue": "^7.0.0",
51
51
  "sqlite3": "^5.1.7",
52
52
  "ufo": "^1.5.4",
53
- "@arcblock/crawler": "1.1.3"
53
+ "@arcblock/crawler": "1.1.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/express": "^4.17.21",