feat(logging): add AI API path support for image routes

- Included `/v1/images` in AI API path prefixes.
- Introduced tests to validate `/v1/images/generations` and `/v1/images/edits` as AI API paths.
This commit is contained in:
Luis Pater
2026-04-24 00:11:42 +08:00
parent 8eb56e5602
commit 25137b1984
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ import (
var aiAPIPrefixes = []string{
"/v1/chat/completions",
"/v1/completions",
"/v1/images",
"/v1/messages",
"/v1/responses",
"/v1beta/models/",
+9
View File
@@ -58,3 +58,12 @@ func TestGinLogrusRecoveryHandlesRegularPanic(t *testing.T) {
t.Fatalf("expected 500, got %d", recorder.Code)
}
}
func TestIsAIAPIPathIncludesImages(t *testing.T) {
if !isAIAPIPath("/v1/images/generations") {
t.Fatalf("expected /v1/images/generations to be treated as AI API path")
}
if !isAIAPIPath("/v1/images/edits") {
t.Fatalf("expected /v1/images/edits to be treated as AI API path")
}
}