forked from cory/tildefriends
Make http.auth_query async and get its DB work off the main thread.
This commit is contained in:
@ -83,10 +83,10 @@ App.prototype.send = function (message) {
|
||||
* @param {*} response
|
||||
* @param {*} client
|
||||
*/
|
||||
function socket(request, response, client) {
|
||||
async function socket(request, response, client) {
|
||||
let process;
|
||||
let options = {};
|
||||
let credentials = httpd.auth_query(request.headers);
|
||||
let credentials = await httpd.auth_query(request.headers);
|
||||
|
||||
response.onClose = async function () {
|
||||
if (process && process.task) {
|
||||
|
@ -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 &&
|
||||
|
Reference in New Issue
Block a user