secure-upload-fastify-sdk 1.0.3 → 1.0.4
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/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -6
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js +1 -6
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1 -6
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/routes/multipart.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -919,10 +919,6 @@ async function resolveSession(req, isPublic, validate) {
|
|
|
919
919
|
const sessionKey = session ?? "anonymous";
|
|
920
920
|
return { userId: userId ?? null, sessionKey };
|
|
921
921
|
}
|
|
922
|
-
function resolveSessionKey(req) {
|
|
923
|
-
const sr = req.secureRequest;
|
|
924
|
-
return sr?.session ?? req.headers["x-secure-session"] ?? "anonymous";
|
|
925
|
-
}
|
|
926
922
|
async function resolveUserId(req, isPublic, validate) {
|
|
927
923
|
const sr = req.secureRequest;
|
|
928
924
|
const session = sr?.session ?? req.headers["x-secure-session"];
|
|
@@ -1264,8 +1260,7 @@ async function registerMultipartRoutes(app, rt) {
|
|
|
1264
1260
|
);
|
|
1265
1261
|
}
|
|
1266
1262
|
const { uploadId, partNumber, partHash } = resolvePartBiz(req);
|
|
1267
|
-
const
|
|
1268
|
-
const rlKey = `rl:mp:part:${sessionKey.slice(0, 64)}`;
|
|
1263
|
+
const rlKey = `rl:mp:part:${uploadId}`;
|
|
1269
1264
|
const rl = await rateLimit(rt, rlKey, 6e4, rt.config.partRateLimit);
|
|
1270
1265
|
if (!rl.ok) {
|
|
1271
1266
|
throw new SecureError(
|