@netlify/blobs
Advanced tools
Comparing version
@@ -11,3 +11,3 @@ import { | ||
setEnvironmentContext | ||
} from "./chunk-BGMFLNF6.js"; | ||
} from "./chunk-HN33TXZT.js"; | ||
@@ -14,0 +14,0 @@ // src/lambda_compat.ts |
@@ -5,5 +5,7 @@ import { | ||
decodeMetadata, | ||
decodeName, | ||
encodeMetadata, | ||
encodeName, | ||
isNodeError | ||
} from "./chunk-BGMFLNF6.js"; | ||
} from "./chunk-HN33TXZT.js"; | ||
@@ -15,3 +17,2 @@ // src/server.ts | ||
import { dirname, join, relative, resolve, sep } from "path"; | ||
import { platform } from "process"; | ||
import { HTTPServer } from "@netlify/dev-utils"; | ||
@@ -141,3 +142,3 @@ var API_URL_PATH = /\/api\/v1\/blobs\/(?<site_id>[^/]+)\/(?<store_name>[^/]+)\/?(?<key>[^?]*)/; | ||
async listBlobs(options) { | ||
const { dataPath, rootPath, req, url } = options; | ||
const { dataPath, rootPath, url } = options; | ||
const directories = url.searchParams.get("directories") === "true"; | ||
@@ -163,3 +164,3 @@ const prefix = url.searchParams.get("prefix") ?? ""; | ||
const allStores = await fs.readdir(rootPath); | ||
const filteredStores = allStores.map((store) => platform === "win32" ? decodeURIComponent(store) : store).filter((store) => store.startsWith(prefix)); | ||
const filteredStores = allStores.map(decodeName).filter((store) => store.startsWith(prefix)); | ||
return Response.json({ stores: filteredStores }); | ||
@@ -240,3 +241,3 @@ } catch (error) { | ||
} | ||
const [siteID, rawStoreName, ...key] = parts; | ||
const [siteID, rawStoreName, ...rawKey] = parts; | ||
if (!siteID) { | ||
@@ -249,3 +250,4 @@ return {}; | ||
} | ||
const storeName = platform === "win32" ? encodeURIComponent(rawStoreName) : rawStoreName; | ||
const key = rawKey.map(encodeName); | ||
const storeName = encodeName(rawStoreName); | ||
const storePath = resolve(rootPath, storeName); | ||
@@ -252,0 +254,0 @@ const dataPath = resolve(storePath, ...key); |
{ | ||
"name": "@netlify/blobs", | ||
"version": "10.0.1", | ||
"version": "10.0.2", | ||
"description": "TypeScript client for Netlify Blobs", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
122352
2.22%2855
2.55%4
-81.82%