mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-04 19:32:12 +00:00
parent
9fb80bbd6a
commit
f54e6905b7
1 changed files with 4 additions and 7 deletions
|
|
@ -101,8 +101,8 @@ const isGetStateRequest = (reqUrlStr: string, reqMethod: string) => {
|
||||||
reqPathnameParts?.[1] === "api" &&
|
reqPathnameParts?.[1] === "api" &&
|
||||||
reqPathnameParts?.[2] === "threads" &&
|
reqPathnameParts?.[2] === "threads" &&
|
||||||
validate(reqPathnameParts?.[3]) &&
|
validate(reqPathnameParts?.[3]) &&
|
||||||
reqPathnameParts?.[4] === "state";
|
reqPathnameParts?.[4] === "state" &&
|
||||||
reqMethod.toLowerCase() === "get";
|
reqMethod.toLowerCase() === "get";
|
||||||
return isGetStateReq;
|
return isGetStateReq;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -115,8 +115,8 @@ const isSearchThreadsRequest = (reqUrlStr: string, reqMethod: string) => {
|
||||||
const isGetStateReq =
|
const isGetStateReq =
|
||||||
reqPathnameParts?.[1] === "api" &&
|
reqPathnameParts?.[1] === "api" &&
|
||||||
reqPathnameParts?.[2] === "threads" &&
|
reqPathnameParts?.[2] === "threads" &&
|
||||||
reqPathnameParts?.[3] === "search";
|
reqPathnameParts?.[3] === "search" &&
|
||||||
reqMethod.toLowerCase() === "get";
|
reqMethod.toLowerCase() === "post";
|
||||||
return isGetStateReq;
|
return isGetStateReq;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -143,10 +143,7 @@ async function getInstallationNameFromReq(
|
||||||
isGetStateRequest(req.url, req.method) ||
|
isGetStateRequest(req.url, req.method) ||
|
||||||
isSearchThreadsRequest(req.url, req.method)
|
isSearchThreadsRequest(req.url, req.method)
|
||||||
) {
|
) {
|
||||||
console.log("Trying to get installation name from request");
|
|
||||||
return await getInstallationName(installationId);
|
return await getInstallationName(installationId);
|
||||||
} else {
|
|
||||||
console.log("is not a new run req", req.url);
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue