Skip to content

Commit

Permalink
Fix Content-Disposition header to quote filename for security
Browse files Browse the repository at this point in the history
  • Loading branch information
saivishnu725 committed Dec 2, 2024
1 parent b48ae25 commit 6aa68ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/api/handlers/v1/v1_ctrl_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (ctrl *V1Controller) HandleItemsExport() errchain.HandlerFunc {
filename := fmt.Sprintf("homebox-items_%s.csv", timestamp) // add timestamp to filename

w.Header().Set("Content-Type", "text/csv")
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=%s", filename))
w.Header().Set("Content-Disposition", fmt.Sprintf('attachment;filename=%s', filename))

writer := csv.NewWriter(w)
writer.Comma = ','
Expand Down

0 comments on commit 6aa68ca

Please sign in to comment.