Skip to content

Commit 9073f99

Browse files
committed
fix: Set content type for file downloads in viewer handler
1 parent b87858b commit 9073f99

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/viewer/handlers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ func (v *Viewer) fileHandler(w http.ResponseWriter, r *http.Request) {
211211
filename = r.PathValue("filename")
212212
ctx = r.Context()
213213
)
214+
215+
// Setting content type to application/octet-stream to support any files without extensions (e.g. Canvas files)
216+
w.Header().Set("Content-Type", "application/octet-stream")
214217
if id == "" || filename == "" || isInvalid(filename) || isInvalid(id) {
215218
http.NotFound(w, r)
216219
return

0 commit comments

Comments
 (0)