Skip to content

Commit d926db4

Browse files
committed
perf(039): strip sarif_raw from report API (2.1MB -> 2.9KB)
SARIF raw data can be 2MB+ (Semgrep includes all rule definitions). Web UI was stuck on "Loading scan report..." because of this. Now stripped by default; add ?include_sarif=true for CLI --output sarif. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 409ca43 commit d926db4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/httpapi/security_scanner.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@ func (s *Server) handleGetScanReport(w http.ResponseWriter, r *http.Request) {
210210
s.writeError(w, r, http.StatusNotFound, err.Error())
211211
return
212212
}
213+
214+
// Strip sarif_raw from response unless ?include_sarif=true (it can be 2MB+)
215+
if r.URL.Query().Get("include_sarif") != "true" {
216+
for i := range report.Reports {
217+
report.Reports[i].SarifRaw = nil
218+
}
219+
}
220+
213221
s.writeSuccess(w, report)
214222
}
215223

0 commit comments

Comments
 (0)