mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 18:15:48 +00:00
fix(error-logs): fix endpoint regex for v1/messages URL format
This commit is contained in:
1 parent
ecfdcdef78
commit
19550b28f0
1 file changed
+3
-2
@@ -237,8 +237,9 @@ function computeDerivedFields(result: ParsedErrorLog): void {
|
|||||||
result.provider = providerMatch[1];
|
result.provider = providerMatch[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract endpoint from URL
|
// Extract endpoint from URL: /api/provider/{provider}/{version}/{endpoint}
|
||||||
const endpointMatch = result.url.match(/\/api\/provider\/[^/]+\/api\/(.+)/);
|
// e.g., /api/provider/agy/v1/messages?beta=true → v1/messages
|
||||||
|
const endpointMatch = result.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);
|
||||||
if (endpointMatch) {
|
if (endpointMatch) {
|
||||||
result.endpoint = endpointMatch[1];
|
result.endpoint = endpointMatch[1];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user