From f70e4886623a43ef156257444bf9e4e54cd64f94 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Sun, 7 Jun 2026 15:22:52 +0530 Subject: [PATCH] refactor: sanitize only the reference number for transcript filename --- cmd/conversation.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/conversation.go b/cmd/conversation.go index 1e8f014f..453699cc 100644 --- a/cmd/conversation.go +++ b/cmd/conversation.go @@ -354,7 +354,8 @@ func handleDownloadConversationTranscript(r *fastglue.Request) error { } transcript := app.conversation.BuildTranscript(*conversation, messages, time.Now()) - filename := stringutil.SanitizeFilename(fmt.Sprintf("transcript-%s.txt", conversation.ReferenceNumber)) + safeRef := stringutil.SanitizeFilename(conversation.ReferenceNumber) + filename := fmt.Sprintf("transcript-%s.txt", safeRef) r.RequestCtx.Response.Header.Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename)) r.RequestCtx.Response.Header.Set("X-Content-Type-Options", "nosniff") r.RequestCtx.SetContentType("text/plain; charset=utf-8")