feat: support Grok video edits and extensions

This commit is contained in:
chenjian
2026-07-13 10:50:42 +08:00
parent b73d8c3efe
commit 909b96edd2
11 changed files with 135 additions and 6 deletions
+2 -1
View File
@@ -308,7 +308,8 @@ func shouldBypassEmbeddedFrontend(path string) bool {
trimmed == "/health" ||
trimmed == "/responses" ||
strings.HasPrefix(trimmed, "/responses/") ||
strings.HasPrefix(trimmed, "/images/")
strings.HasPrefix(trimmed, "/images/") ||
strings.HasPrefix(trimmed, "/videos/")
}
func serveIndexHTML(c *gin.Context, fsys fs.FS) {
+11
View File
@@ -562,6 +562,17 @@ func TestFrontendServer_Middleware(t *testing.T) {
})
}
func TestEmbeddedFrontendBypassesBareVideoAPIRoutes(t *testing.T) {
for _, path := range []string{
"/videos/generations",
"/videos/edits",
"/videos/extensions",
"/videos/request-123",
} {
require.True(t, shouldBypassEmbeddedFrontend(path), "path=%s", path)
}
}
func TestNewFrontendServer(t *testing.T) {
t.Run("creates_server_successfully", func(t *testing.T) {
provider := &mockSettingsProvider{