Make http.auth_query async and get its DB work off the main thread.

This commit is contained in:
2024-06-10 20:22:28 -04:00
parent c5140ee8e8
commit 58bb86ebe1
5 changed files with 67 additions and 40 deletions

View File

@ -908,7 +908,7 @@ async function useAppHandler(
},
respond: do_resolve,
},
credentials: httpd.auth_query(headers),
credentials: await httpd.auth_query(headers),
packageOwner: packageOwner,
packageName: packageName,
}
@ -1039,7 +1039,7 @@ async function blobHandler(request, response, blobId, uri) {
if ((match = /^\/\~(\w+)\/(\w+)$/.exec(blobId))) {
let user = match[1];
let appName = match[2];
let credentials = httpd.auth_query(request.headers);
let credentials = await httpd.auth_query(request.headers);
if (
credentials &&
credentials.session &&
@ -1102,7 +1102,7 @@ async function blobHandler(request, response, blobId, uri) {
if ((match = /^\/\~(\w+)\/(\w+)$/.exec(blobId))) {
let user = match[1];
let appName = match[2];
let credentials = httpd.auth_query(request.headers);
let credentials = await httpd.auth_query(request.headers);
if (
credentials &&
credentials.session &&