resolve GHSA-jwqg-jfg3-x5vv
This commit is contained in:
parent
f144692903
commit
4f3f77119d
@ -618,12 +618,15 @@ function workspaceEndpoints(app) {
|
|||||||
try {
|
try {
|
||||||
const { chatId } = request.params;
|
const { chatId } = request.params;
|
||||||
const workspace = response.locals.workspace;
|
const workspace = response.locals.workspace;
|
||||||
|
const user = await userFromSession(request, response);
|
||||||
const cacheKey = `${workspace.slug}:${chatId}`;
|
const cacheKey = `${workspace.slug}:${chatId}`;
|
||||||
const wsChat = await WorkspaceChats.get({
|
const wsChat = await WorkspaceChats.get({
|
||||||
id: Number(chatId),
|
id: Number(chatId),
|
||||||
workspaceId: workspace.id,
|
workspaceId: workspace.id,
|
||||||
|
user_id: user?.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!wsChat) return response.sendStatus(404);
|
||||||
const cachedResponse = responseCache.get(cacheKey);
|
const cachedResponse = responseCache.get(cacheKey);
|
||||||
if (cachedResponse) {
|
if (cachedResponse) {
|
||||||
response.writeHead(200, {
|
response.writeHead(200, {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user