Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit acd6881

Browse files
committed
feat(server): fix lint type errors for normalizing server URLs
1 parent bb70c2a commit acd6881

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

apps/server/src/routes/custom.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ function handleRequest(req: Request, res: Response) {
4040

4141
// Get normalized patterns to handle both trailing slash cases
4242
const patterns = normalizeCustomHandlerPattern(attr.value);
43-
let match = null;
43+
let match: RegExpMatchArray | null = null;
4444

45-
// Try each pattern until we find a match
46-
for (const pattern of patterns) {
47-
try {
45+
try {
46+
// Try each pattern until we find a match
47+
for (const pattern of patterns) {
4848
const regex = new RegExp(`^${pattern}$`);
4949
match = path.match(regex);
5050
if (match) {
5151
break; // Found a match, exit pattern loop
5252
}
53-
} catch (e: unknown) {
54-
const [errMessage, errStack] = safeExtractMessageAndStackFromError(e);
55-
log.error(`Testing path for label '${attr.attributeId}', regex '${pattern}' failed with error: ${errMessage}, stack: ${errStack}`);
56-
continue;
5753
}
54+
} catch (e: unknown) {
55+
const [errMessage, errStack] = safeExtractMessageAndStackFromError(e);
56+
log.error(`Testing path for label '${attr.attributeId}', regex '${attr.value}' failed with error: ${errMessage}, stack: ${errStack}`);
57+
continue;
5858
}
5959

6060
if (!match) {

0 commit comments

Comments
 (0)