@dutodev/cli 1.6.0 → 1.6.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/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ import { join as join5, relative } from "path";
57
57
  import cac from "cac";
58
58
 
59
59
  // src/version.ts
60
- var CLI_VERSION = "1.6.0";
60
+ var CLI_VERSION = "1.6.1";
61
61
 
62
62
  // src/api.ts
63
63
  var DutoApiError = class extends Error {
@@ -561,7 +561,7 @@ async function browserLogin(o) {
561
561
  const start = await api.startLogin({
562
562
  deviceId: o.deviceId,
563
563
  deviceName: hostname(),
564
- cliVersion: "1.6.0",
564
+ cliVersion: "1.6.1",
565
565
  nodeVersion: process.version,
566
566
  os: process.platform,
567
567
  arch: process.arch
@@ -1749,9 +1749,12 @@ function cookieIssues(r, ctx) {
1749
1749
  }
1750
1750
  return out;
1751
1751
  }
1752
+ function isPublicOrigin(origin, publicHost) {
1753
+ return publicHost !== null && absoluteUrl(origin)?.host === publicHost.toLowerCase();
1754
+ }
1752
1755
  function corsIssues(r, ctx) {
1753
1756
  const origin = r.reqHeaders.origin;
1754
- if (!origin || r.status === null || ctx.publicHost && origin.toLowerCase() === `https://${ctx.publicHost}`) return [];
1757
+ if (!origin || r.status === null || r.websocket || isPublicOrigin(origin, ctx.publicHost)) return [];
1755
1758
  const allowed = r.resHeaders["access-control-allow-origin"];
1756
1759
  const ok2 = allowed === "*" || allowed === origin;
1757
1760
  const wanted = r.reqHeaders["access-control-request-method"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dutodev/cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Expose a local port at https://<name>-<user>.duto.dev with one command.",
5
5
  "license": "MIT",
6
6
  "type": "module",