@adobe/aem-cli 16.10.47 → 16.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [16.11.1](https://github.com/adobe/helix-cli/compare/v16.11.0...v16.11.1) (2025-09-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external major ([4264c86](https://github.com/adobe/helix-cli/commit/4264c86f4548776c111df865019278eb6a33ff30))
7
+ * sync package-lock.json with package.json ([e473529](https://github.com/adobe/helix-cli/commit/e47352939f3817b68e193b96037103edb00ca9f4)), closes [#2580](https://github.com/adobe/helix-cli/issues/2580)
8
+
9
+ # [16.11.0](https://github.com/adobe/helix-cli/compare/v16.10.47...v16.11.0) (2025-09-04)
10
+
11
+
12
+ ### Features
13
+
14
+ * **up:** proxy all cookie and set-cookie headers ([b1d3eb2](https://github.com/adobe/helix-cli/commit/b1d3eb2c12c19e36fcd922a274ff487be4e07d53))
15
+
1
16
  ## [16.10.47](https://github.com/adobe/helix-cli/compare/v16.10.46...v16.10.47) (2025-09-02)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aem-cli",
3
- "version": "16.10.47",
3
+ "version": "16.11.1",
4
4
  "description": "AEM CLI",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -73,7 +73,7 @@
73
73
  "semver": "7.7.2",
74
74
  "shelljs": "0.10.0",
75
75
  "unified": "11.0.5",
76
- "uuid": "11.1.0",
76
+ "uuid": "13.0.0",
77
77
  "yargs": "18.0.0"
78
78
  },
79
79
  "devDependencies": {
@@ -68,6 +68,11 @@ export class HelixProject extends BaseProject {
68
68
  return this;
69
69
  }
70
70
 
71
+ withCookies(value) {
72
+ this._server.withCookies(value);
73
+ return this;
74
+ }
75
+
71
76
  get proxyUrl() {
72
77
  return this._proxyUrl;
73
78
  }
@@ -34,6 +34,7 @@ export class HelixServer extends BaseServer {
34
34
  this._enableLiveReload = false;
35
35
  this._app.use(compression());
36
36
  this._autoLogin = true;
37
+ this._cookies = false;
37
38
  }
38
39
 
39
40
  withLiveReload(value) {
@@ -46,6 +47,11 @@ export class HelixServer extends BaseServer {
46
47
  return this;
47
48
  }
48
49
 
50
+ withCookies(value) {
51
+ this._cookies = value;
52
+ return this;
53
+ }
54
+
49
55
  async handleLogin(req, res) {
50
56
  // disable autologin if login was called at least once
51
57
  this._autoLogin = false;
@@ -205,6 +211,7 @@ export class HelixServer extends BaseServer {
205
211
  siteToken: this._siteToken,
206
212
  loginPath: LOGIN_ROUTE,
207
213
  autoLogin: this._autoLogin,
214
+ cookies: this._cookies,
208
215
  });
209
216
  } catch (err) {
210
217
  log.error(`${pfx}failed to proxy AEM request ${ctx.path}: ${err.message}`);
@@ -254,14 +254,16 @@ window.LiveReloadOptions = {
254
254
  headers.authorization = `token ${opts.siteToken}`;
255
255
  }
256
256
 
257
- // preserve hlx-auth-token cookie
258
- const cookies = cookie.parse(headers.cookie || '');
259
- delete headers.cookie;
260
- const hlxAuthToken = cookies['hlx-auth-token'];
261
- if (hlxAuthToken) {
262
- headers.cookie = new URLSearchParams({
263
- 'hlx-auth-token': hlxAuthToken,
264
- }).toString();
257
+ if (!opts.cookies) {
258
+ // only pass through hlx-auth-token cookie
259
+ const cookies = cookie.parse(headers.cookie || '');
260
+ delete headers.cookie;
261
+ const hlxAuthToken = cookies['hlx-auth-token'];
262
+ if (hlxAuthToken) {
263
+ headers.cookie = new URLSearchParams({
264
+ 'hlx-auth-token': hlxAuthToken,
265
+ }).toString();
266
+ }
265
267
  }
266
268
 
267
269
  delete headers.connection;
@@ -278,8 +280,13 @@ window.LiveReloadOptions = {
278
280
  const level = utils.status2level(ret.status, true);
279
281
  ctx.log[level](`[${id}] Proxy ${req.method} request to ${url}: ${ret.status} (${contentType})`);
280
282
 
281
- // because fetch decodes the response, we need to reset content encoding and length
282
283
  const respHeaders = Object.fromEntries(ret.headers.entries());
284
+ // multiple Set-Cookie headers need special handling
285
+ // https://www.npmjs.com/package/node-fetch#extract-set-cookie-header
286
+ const setCookieValues = ret.headers.raw()['set-cookie'];
287
+ if (setCookieValues?.length) {
288
+ respHeaders['set-cookie'] = setCookieValues;
289
+ }
283
290
  delete respHeaders['content-encoding'];
284
291
  delete respHeaders['content-length'];
285
292
  delete respHeaders['x-frame-options'];
package/src/up.cmd.js CHANGED
@@ -44,6 +44,11 @@ export default class UpCommand extends AbstractServerCommand {
44
44
  return this;
45
45
  }
46
46
 
47
+ withCookies(value) {
48
+ this._cookies = value;
49
+ return this;
50
+ }
51
+
47
52
  async doStop() {
48
53
  await super.doStop();
49
54
  if (this._watcher) {
@@ -76,7 +81,8 @@ export default class UpCommand extends AbstractServerCommand {
76
81
  .withKill(this._kill)
77
82
  .withPrintIndex(this._printIndex)
78
83
  .withAllowInsecure(this._allowInsecure)
79
- .withSiteToken(this._siteToken);
84
+ .withSiteToken(this._siteToken)
85
+ .withCookies(this._cookies);
80
86
 
81
87
  this.log.info(chalk`{yellow ___ ________ ___ __ __ v${pkgJson.version}}`);
82
88
  this.log.info(chalk`{yellow / | / ____/ |/ / _____(_)___ ___ __ __/ /___ _/ /_____ _____}`);
package/src/up.js CHANGED
@@ -104,6 +104,11 @@ export default function up() {
104
104
  type: 'boolean',
105
105
  default: false,
106
106
  })
107
+ .option('cookies', {
108
+ describe: 'Proxy all cookies in requests. By default, only the hlx-auth-token cookie is proxied.',
109
+ type: 'boolean',
110
+ default: false,
111
+ })
107
112
 
108
113
  .help();
109
114
  },
@@ -128,6 +133,7 @@ export default function up() {
128
133
  .withAllowInsecure(argv.allowInsecure)
129
134
  .withKill(argv.stopOther)
130
135
  .withCache(argv.alphaCache)
136
+ .withCookies(argv.cookies)
131
137
  .run();
132
138
  },
133
139
  };