@adobe/aem-cli 16.15.0 → 16.15.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 +7 -0
- package/package.json +1 -1
- package/src/server/utils.js +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [16.15.1](https://github.com/adobe/helix-cli/compare/v16.15.0...v16.15.1) (2025-09-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* inject hlx:proxyUrl meta tag for 401 and 403 HTML responses ([ff4f2e8](https://github.com/adobe/helix-cli/commit/ff4f2e84e897676141601fccb165d678715b3ac8)), closes [#2414](https://github.com/adobe/helix-cli/issues/2414)
|
|
7
|
+
|
|
1
8
|
# [16.15.0](https://github.com/adobe/helix-cli/compare/v16.14.0...v16.15.0) (2025-09-22)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/server/utils.js
CHANGED
|
@@ -325,6 +325,7 @@ window.LiveReloadOptions = {
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
const isHTML = ret.status === 200 && contentType.indexOf('text/html') === 0;
|
|
328
|
+
const isHTMLWithAuthError = (ret.status === 401 || ret.status === 403) && contentType.indexOf('text/html') === 0;
|
|
328
329
|
const livereload = isHTML && opts.injectLiveReload;
|
|
329
330
|
const replaceHead = isHTML && opts.headHtml;
|
|
330
331
|
const doIndex = isHTML && opts.indexer && url.indexOf('.plain.html') < 0;
|
|
@@ -380,6 +381,24 @@ window.LiveReloadOptions = {
|
|
|
380
381
|
.send(textBody);
|
|
381
382
|
return;
|
|
382
383
|
}
|
|
384
|
+
if (isHTMLWithAuthError) {
|
|
385
|
+
// Handle HTML responses with 401/403 status - inject meta tag
|
|
386
|
+
let textBody = await ret.text();
|
|
387
|
+
if (ctx.log.level === 'silly') {
|
|
388
|
+
ctx.log.trace(textBody);
|
|
389
|
+
ctx.log.trace(`[${id}] <<<--------------------------`);
|
|
390
|
+
}
|
|
391
|
+
textBody = utils.injectMeta(textBody, {
|
|
392
|
+
'hlx:proxyUrl': url,
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
res
|
|
396
|
+
.set(respHeaders)
|
|
397
|
+
.status(ret.status)
|
|
398
|
+
.send(textBody);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
383
402
|
if (ret.status === 401 || ret.status === 403) {
|
|
384
403
|
const reqHeaders = req.headers;
|
|
385
404
|
if (opts.autoLogin && opts.loginPath
|