launch-editor-middleware 2.11.0 → 2.11.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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -18,7 +18,8 @@ module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
18
18
  let url
19
19
 
20
20
  try {
21
- url = new URL(req.url)
21
+ const fullUrl = req.url.startsWith('http') ? req.url : `http://localhost${req.url}`
22
+ url = new URL(fullUrl)
22
23
  // eslint-disable-next-line no-unused-vars
23
24
  } catch (_err) {
24
25
  res.statusCode = 500
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launch-editor-middleware",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "express middleware for launching editor",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "homepage": "https://github.com/yyx990803/launch-editor#readme",
24
24
  "dependencies": {
25
- "launch-editor": "^2.11.0"
25
+ "launch-editor": "^2.11.1"
26
26
  },
27
27
  "scripts": {
28
28
  "test": "node --test --experimental-test-module-mocks"