@cloudflare/sandbox 0.12.8 → 0.12.9

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.
@@ -5322,6 +5322,13 @@ function xmlResponse(body, status = 200) {
5322
5322
  function normalizeObjectKey(value) {
5323
5323
  return value.replace(/^\/+/, "");
5324
5324
  }
5325
+ function decodeObjectKey(value) {
5326
+ try {
5327
+ return decodeURIComponent(value);
5328
+ } catch {
5329
+ return value;
5330
+ }
5331
+ }
5325
5332
  function trimTrailingSlashes(s) {
5326
5333
  let end = s.length;
5327
5334
  while (end > 0 && s[end - 1] === "/") end--;
@@ -5609,7 +5616,8 @@ const r2EgressHandler = async (request, env$1, ctx) => {
5609
5616
  const url = new URL(request.url);
5610
5617
  const parsed = parsePath(url.pathname);
5611
5618
  if (!parsed) return new Response("Bad Request: empty path", { status: 400 });
5612
- const { bucket: bucketName, key } = parsed;
5619
+ const { bucket: bucketName, key: encodedKey } = parsed;
5620
+ const key = decodeObjectKey(encodedKey);
5613
5621
  if (!ctx.params?.buckets || !(bucketName in ctx.params.buckets)) return new Response(`Access to R2 bucket "${bucketName}" is not permitted. Call mountBucket() with this bucket before accessing it.`, { status: 403 });
5614
5622
  const bucketParams = ctx.params.buckets[bucketName];
5615
5623
  const mountPrefix = normalizeMountPrefix(bucketParams.prefix);
@@ -7172,7 +7180,7 @@ function createTunnelsHandler(host) {
7172
7180
  * This file is auto-updated by .github/changeset-version.ts during releases
7173
7181
  * DO NOT EDIT MANUALLY - Changes will be overwritten on the next version bump
7174
7182
  */
7175
- const SDK_VERSION = "0.12.8";
7183
+ const SDK_VERSION = "0.12.9";
7176
7184
 
7177
7185
  //#endregion
7178
7186
  //#region src/sandbox.ts
@@ -11553,4 +11561,4 @@ var Sandbox = class Sandbox extends Container {
11553
11561
 
11554
11562
  //#endregion
11555
11563
  export { PortClient as A, InvalidBackupConfigError as B, collectFile as C, SandboxClient as D, isPlatformTransientError as E, BackupCreateError as F, SessionTerminatedError as G, ProcessExitedBeforeReadyError as H, BackupExpiredError as I, BackupNotFoundError as L, FileClient as M, CommandClient as N, UtilityClient as O, BackupClient as P, BackupRestoreError as R, validateTunnelName as S, isDurableObjectCodeUpdateReset as T, ProcessReadyTimeoutError as U, OperationInterruptedError as V, RPCTransportError as W, responseToAsyncIterable as _, PREVIEW_PROXY_HEADER as a, sanitizeSandboxId as b, PREVIEW_PROXY_SANDBOX_ID_HEADER as c, BucketUnmountError as d, InvalidMountConfigError as f, parseSSEStream as g, asyncIterableToSSEStream as h, proxyTerminal as i, GitClient as j, ProcessClient as k, PREVIEW_PROXY_TOKEN_HEADER as l, S3FSMountError as m, Sandbox as n, PREVIEW_PROXY_HEADERS as o, MissingCredentialsError as p, getSandbox as r, PREVIEW_PROXY_PORT_HEADER as s, ContainerProxy$1 as t, BucketMountError as u, CodeInterpreter as v, streamFile as w, validatePort as x, SandboxSecurityError as y, ContainerUnavailableError as z };
11556
- //# sourceMappingURL=sandbox-CPj2jsbz.js.map
11564
+ //# sourceMappingURL=sandbox-D0rNqxlr.js.map