@servicenow/aiux 22.42.1 → 22.42.3
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/components/dist/vN/{aiel-c1rnJf9J.js → aiel-Drv2KiHy.js} +3 -3
- package/components/dist/vN/{aiex-BOLhPDhB.js → aiex-Dh5lMLmr.js} +29 -38
- package/components/dist/vN/manifest.json +4 -4
- package/components/dist/vN/{nav-BDWkv54f.js → nav-BatrrdNH.js} +3 -3
- package/components/nav/src/constants.js +2 -1
- package/components/nav/src/nav-layout/src/nav-layout.js +2 -0
- package/components/nav/vN/index.js +4 -2
- package/components/package.json +3 -3
- package/core/commons/package.json +1 -1
- package/core/sdk/dist/build.browser.js +38 -9
- package/core/sdk/package.json +1 -1
- package/core/sdk/src/build-metadata-records/lifecycle.js +7 -3
- package/core/sdk/src/build-runtime-manifest/build.js +46 -6
- package/libraries/aiux-devtools/package.json +1 -1
- package/libraries/aiux-devtools/src/index.js +55 -5
- package/libraries/aiux-devtools/src/store/preferences.js +2 -0
- package/libraries/aiux-devtools/src/ui/shell/devtools-panel.js +80 -43
- package/libraries/aiux-devtools/src/ui/shell/overlay-manager.js +35 -7
- package/package.json +1 -1
- package/public-dev-server/server/package.json +1 -1
- package/public-dev-server/server/src/glide-proxy.js +26 -3
- package/public-dev-server/server/src/server.js +15 -0
|
@@ -15,9 +15,32 @@ import {fetch as undiciFetch} from 'undici';
|
|
|
15
15
|
* authenticate as the interacting logged-in user).
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
// Hop-by-hop headers that must not be forwarded (RFC 7230 §6.1) +
|
|
19
|
-
// we
|
|
20
|
-
|
|
18
|
+
// Hop-by-hop headers that must not be forwarded (RFC 7230 §6.1) + `host`,
|
|
19
|
+
// which we overwrite with the instance host below.
|
|
20
|
+
//
|
|
21
|
+
// `content-length` is deliberately NOT here: it is an end-to-end header, and
|
|
22
|
+
// the body is forwarded as an unread stream (see the content-type parser
|
|
23
|
+
// below), so undici cannot recompute it. Stripping it made undici fall back to
|
|
24
|
+
// `Transfer-Encoding: chunked`, which Glide's servlet stack rejects with
|
|
25
|
+
// 411 Length Required, killing every bodied POST, most visibly the single
|
|
26
|
+
// /api/now/v1/batch request that carries a page's widget data (DEF0879731).
|
|
27
|
+
// Since the proxy never touches the body bytes, the browser's own
|
|
28
|
+
// Content-Length stays numerically correct.
|
|
29
|
+
//
|
|
30
|
+
// `transfer-encoding` IS stripped: it describes the client->dev-server hop
|
|
31
|
+
// only, and undici throws `invalid transfer-encoding header` if it is set on
|
|
32
|
+
// an outgoing fetch (undici owns framing for the upstream hop). Same rationale
|
|
33
|
+
// as prod's h2-proxy, which strips host/connection/transfer-encoding/
|
|
34
|
+
// keep-alive/upgrade and passes content-length through untouched.
|
|
35
|
+
const STRIP_REQUEST_HEADERS = new Set([
|
|
36
|
+
'host',
|
|
37
|
+
'connection',
|
|
38
|
+
'keep-alive',
|
|
39
|
+
'transfer-encoding',
|
|
40
|
+
'upgrade',
|
|
41
|
+
// undici rejects an outgoing `expect` header outright.
|
|
42
|
+
'expect'
|
|
43
|
+
]);
|
|
21
44
|
const STRIP_RESPONSE_HEADERS = new Set([
|
|
22
45
|
'transfer-encoding',
|
|
23
46
|
'connection',
|
|
@@ -339,6 +339,21 @@ export async function createSimpleDevServer({
|
|
|
339
339
|
// local dev tool — no graceful-drain requirement.
|
|
340
340
|
const fastify = Fastify({logger: false, forceCloseConnections: true});
|
|
341
341
|
|
|
342
|
+
// Bind is wildcard (0.0.0.0), not loopback — macOS returns EACCES binding
|
|
343
|
+
// 127.0.0.1 on a privileged port (<1024), so :80 only works via wildcard.
|
|
344
|
+
// Reject anything not from the loopback interface here instead: local dev
|
|
345
|
+
// tool running unsandboxed customer code, must not be reachable from the LAN.
|
|
346
|
+
const LOOPBACK_ADDRESSES = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);
|
|
347
|
+
fastify.addHook('onRequest', async (req, reply) => {
|
|
348
|
+
if (!LOOPBACK_ADDRESSES.has(req.socket.remoteAddress)) {
|
|
349
|
+
return reply
|
|
350
|
+
.code(403)
|
|
351
|
+
.send(
|
|
352
|
+
'Forbidden: this dev server only accepts connections from localhost.'
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
342
357
|
// --- HMR client script ---
|
|
343
358
|
// Served at a fixed path and injected into every rendered document (below) so
|
|
344
359
|
// the browser opens the HMR WebSocket and full-reloads on rebuild. Null when
|