@blaxel/core 0.3.11-preview.244 → 0.3.11-preview.246
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/h2fetch.js +19 -0
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/h2fetch.js +19 -0
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import http2 from "http2";
|
|
2
2
|
import { settings } from "./settings.js";
|
|
3
3
|
import { refH2SessionForActiveRequest } from "./h2ref.js";
|
|
4
|
+
// Statuses the Response constructor refuses to pair with a body. Handing it one
|
|
5
|
+
// throws, so a 204 (e.g. from a DELETE) would blow up instead of resolving.
|
|
6
|
+
const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
|
|
4
7
|
const MIN_H2_SESSION_MAX_LISTENERS = 64;
|
|
5
8
|
const sessionsWithListenerBudget = new WeakSet();
|
|
6
9
|
// Number of transparent re-sends the gateway performs for a request the peer
|
|
@@ -512,6 +515,22 @@ function _h2Send(session, h2Headers, body, signal, fallbackUrl, fallbackInit, op
|
|
|
512
515
|
continue;
|
|
513
516
|
resHeaders.set(k, Array.isArray(v) ? v.join(", ") : String(v));
|
|
514
517
|
}
|
|
518
|
+
if (NULL_BODY_STATUSES.has(status)) {
|
|
519
|
+
// Drain instead of wrapping: the stream still has to end for the h2 slot
|
|
520
|
+
// to be released, but the response must carry no body.
|
|
521
|
+
req.resume();
|
|
522
|
+
// `close` rather than `end`: it also fires when the drain ends on an
|
|
523
|
+
// error (RST_STREAM), which `end` does not, and the outer error handler
|
|
524
|
+
// cannot cover since the request is already settled.
|
|
525
|
+
req.once("close", () => {
|
|
526
|
+
if (streamClosed)
|
|
527
|
+
return;
|
|
528
|
+
streamClosed = true;
|
|
529
|
+
cleanupActiveRequest();
|
|
530
|
+
});
|
|
531
|
+
resolve(new Response(null, { status, headers: resHeaders }));
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
515
534
|
const readable = new ReadableStream({
|
|
516
535
|
start(controller) {
|
|
517
536
|
streamController = controller;
|
|
@@ -24,8 +24,8 @@ function missingCredentialsMessage() {
|
|
|
24
24
|
return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
|
|
25
25
|
}
|
|
26
26
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
27
|
-
const BUILD_VERSION = "0.3.11-preview.
|
|
28
|
-
const BUILD_COMMIT = "
|
|
27
|
+
const BUILD_VERSION = "0.3.11-preview.246";
|
|
28
|
+
const BUILD_COMMIT = "bc44c2710d06faf12313fd4782c1d65146338b0d";
|
|
29
29
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
30
30
|
const BLAXEL_API_VERSION = "2026-04-28";
|
|
31
31
|
// Bun < 1.3.11 never sends connection-level WINDOW_UPDATE: the pooled h2
|