Files
warmbly/internal/api/handler/ai_agent_cache_test.go
T
Matthew MeszarosandDevin AI 416c4feee3 feat: prevent private API response storage and remove wildcard CORS from the static Pages dashboard
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-06 12:05:54 +00:00

24 lines
545 B
Go

package handler
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
)
func TestSSEEmitterDoesNotStoreEvents(t *testing.T) {
gin.SetMode(gin.TestMode)
w := httptest.NewRecorder()
c, _ := gin.CreateTestContext(w)
c.Request = httptest.NewRequest(http.MethodPost, "/v1/ai/agent", nil)
sseEmitter(c)
if got := w.Header().Get("Cache-Control"); got != "no-cache, no-store" {
t.Errorf("Cache-Control = %q, want no-cache, no-store", got)
}
if !w.Flushed {
t.Error("event stream should flush immediately")
}
}