@ai-ecoverse/slicc-kernel 1.94.2 → 1.94.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.
@@ -4703,7 +4703,7 @@ var KERNEL_VERSION, OS_RELEASE;
4703
4703
  var init_version = __esm({
4704
4704
  "src/version.ts"() {
4705
4705
  "use strict";
4706
- KERNEL_VERSION = true ? "1.94.2" : "0.0.0-dev";
4706
+ KERNEL_VERSION = true ? "1.94.3" : "0.0.0-dev";
4707
4707
  OS_RELEASE = "6.0.0-slicc";
4708
4708
  }
4709
4709
  });
@@ -12155,7 +12155,8 @@ var init_js_kernel = __esm({
12155
12155
  "fd-read",
12156
12156
  "fd-write",
12157
12157
  "fd-close",
12158
- "fd-open-clipboard"
12158
+ "fd-open-clipboard",
12159
+ "net-ws-ready"
12159
12160
  ]);
12160
12161
  JsKernel = class {
12161
12162
  header;
@@ -13080,14 +13081,19 @@ function badPort(url) {
13080
13081
  const port2 = url.port ? Number(url.port) : 0;
13081
13082
  return port2 !== 0 && BAD_PORTS.has(port2);
13082
13083
  }
13083
- function rewrite(hop, status2, location) {
13084
- const next2 = new URL(location, hop.url);
13085
- if (next2.protocol !== "http:" && next2.protocol !== "https:") {
13086
- throw failed3(new JsCallError("EPROTONOSUPPORT", next2.protocol));
13084
+ function checkUrl(url) {
13085
+ const parsed = new URL(url);
13086
+ const { protocol } = parsed;
13087
+ if (protocol !== "http:" && protocol !== "https:") {
13088
+ throw failed3(new JsCallError("EPROTONOSUPPORT", protocol));
13087
13089
  }
13088
- if (badPort(next2)) {
13089
- throw failed3(new JsCallError("EACCES", `bad port: ${next2.href}`));
13090
+ if (badPort(parsed) && !local2(url)) {
13091
+ throw failed3(new JsCallError("EACCES", `bad port: ${url}`));
13090
13092
  }
13093
+ }
13094
+ function rewrite(hop, status2, location) {
13095
+ const next2 = new URL(location, hop.url);
13096
+ checkUrl(next2.href);
13091
13097
  if (local2(next2.href) && !local2(hop.url)) {
13092
13098
  const from = new URL(hop.url).origin;
13093
13099
  throw failed3(
@@ -13313,7 +13319,7 @@ function fetchOp(kernel) {
13313
13319
  } catch (err) {
13314
13320
  settle();
13315
13321
  await close(handle);
13316
- throw signal.aborted ? signal.reason : failed3(err);
13322
+ throw signal.aborted ? signal.reason : new TypeError("terminated", { cause: err });
13317
13323
  }
13318
13324
  const bytes = r.ok && r.kind === "bytes" ? r.bytes : new Uint8Array(0);
13319
13325
  if (bytes.length > 0) {
@@ -13347,7 +13353,6 @@ function fetchOp(kernel) {
13347
13353
  stream = stream.pipeThrough(
13348
13354
  new DecompressionStream(format)
13349
13355
  );
13350
- headers.delete("content-encoding");
13351
13356
  headers.delete("content-length");
13352
13357
  }
13353
13358
  const response = new Response(stream, {
@@ -13370,12 +13375,7 @@ function fetchOp(kernel) {
13370
13375
  signal.throwIfAborted();
13371
13376
  const { protocol } = new URL(request.url);
13372
13377
  if (protocol === "data:") return dataResponse(request);
13373
- if (protocol !== "http:" && protocol !== "https:") {
13374
- throw failed3(new JsCallError("EPROTONOSUPPORT", protocol));
13375
- }
13376
- if (badPort(new URL(request.url))) {
13377
- throw failed3(new JsCallError("EACCES", `bad port: ${request.url}`));
13378
- }
13378
+ checkUrl(request.url);
13379
13379
  let known = await traitsAt(request.url);
13380
13380
  if (!known.manualRedirects && request.redirect !== "follow") {
13381
13381
  throw failed3(new JsCallError("ENOTSUP", `redirect: ${request.redirect}`));
@@ -13400,7 +13400,8 @@ function fetchOp(kernel) {
13400
13400
  return respond(head, hop.method, redirected, known.encodedBodies, signal);
13401
13401
  }
13402
13402
  await close(head.handle);
13403
- if (request.redirect === "error") throw failed3(new JsCallError("EREDIRECT", hop.url));
13403
+ if (request.redirect === "error")
13404
+ throw failed3(new JsCallError("EREDIRECT", "unexpected redirect"));
13404
13405
  if (hops >= MAX_REDIRECTS) throw failed3(new JsCallError("ELOOP", hop.url));
13405
13406
  [hop, known] = await redirect(hop, head.status, location, known);
13406
13407
  }