fix: Small nits (#386)

* fix: Small nits

* cr

* cr
This commit is contained in:
Brace Sproul 2025-07-10 17:00:08 -07:00 • committed by GitHub
parent 9fb80bbd6a
commit f54e6905b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,8 +101,8 @@ const isGetStateRequest = (reqUrlStr: string, reqMethod: string) => {
reqPathnameParts?.[1] === "api" &&
reqPathnameParts?.[2] === "threads" &&
validate(reqPathnameParts?.[3]) &&
reqPathnameParts?.[4] === "state";
reqMethod.toLowerCase() === "get";
reqPathnameParts?.[4] === "state" &&
reqMethod.toLowerCase() === "get";
return isGetStateReq;
} catch {
return false;
@ -115,8 +115,8 @@ const isSearchThreadsRequest = (reqUrlStr: string, reqMethod: string) => {
const isGetStateReq =
reqPathnameParts?.[1] === "api" &&
reqPathnameParts?.[2] === "threads" &&
reqPathnameParts?.[3] === "search";
reqMethod.toLowerCase() === "get";
reqPathnameParts?.[3] === "search" &&
reqMethod.toLowerCase() === "post";
return isGetStateReq;
} catch {
return false;
@ -143,10 +143,7 @@ async function getInstallationNameFromReq(
isGetStateRequest(req.url, req.method) ||
isSearchThreadsRequest(req.url, req.method)
) {
console.log("Trying to get installation name from request");
return await getInstallationName(installationId);
} else {
console.log("is not a new run req", req.url);
}
return "";
} catch {