fix price and modular
This commit is contained in:
+13
-6
@@ -411,7 +411,9 @@ function readRawBody(event, encoding = "utf8") {
|
||||
});
|
||||
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
||||
}
|
||||
if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !String(event.node.req.headers["transfer-encoding"] ?? "").split(",").map((e) => e.trim()).filter(Boolean).includes("chunked")) {
|
||||
if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !/\bchunked\b/i.test(
|
||||
String(event.node.req.headers["transfer-encoding"] ?? "")
|
||||
)) {
|
||||
return Promise.resolve(void 0);
|
||||
}
|
||||
const promise = event.node.req[RawBodySymbol] = new Promise(
|
||||
@@ -1433,11 +1435,16 @@ async function updateSession(event, config, update) {
|
||||
async function sealSession(event, config) {
|
||||
const sessionName = config.name || DEFAULT_NAME;
|
||||
const session = event.context.sessions?.[sessionName] || await getSession(event, config);
|
||||
const sealed = await seal(config.crypto || crypto, session, config.password, {
|
||||
...defaults,
|
||||
ttl: config.maxAge ? config.maxAge * 1e3 : 0,
|
||||
...config.seal
|
||||
});
|
||||
const sealed = await seal(
|
||||
config.crypto || crypto,
|
||||
session,
|
||||
config.password,
|
||||
{
|
||||
...defaults,
|
||||
ttl: config.maxAge ? config.maxAge * 1e3 : 0,
|
||||
...config.seal
|
||||
}
|
||||
);
|
||||
return sealed;
|
||||
}
|
||||
async function unsealSession(_event, config, sealed) {
|
||||
|
||||
Reference in New Issue
Block a user