mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
feat: support Grok video edits and extensions
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user