Files
summercms/.planning/todos/done/2026-10-28-attach-static-handler-disposition.md

1.2 KiB

title, date, created, area, severity, priority, g15office, files
title date created area severity priority g15office files
attach.StaticHandler does not send the stored Content-Disposition 2026-10-28 2026-10-28T20:50:55.000Z lagoon/attach minor normal knuu7fil
modules/lagoon/attach

Problem

Follow-up from quick 261028-rqe (ba8432c, 4957e5c). attach.Store saves Content-Disposition: attachment for non-inline types and the surf uploads route sends it, but attach.StaticHandler and attach.StaticHandlerPublic serve blobs without the stored disposition, so an app that mounts them directly serves an HTML body inline.

Solution

  • Make both handlers send the stored disposition (and X-Content-Type-Options: nosniff), additive.
  • Blob writers that bypass attach.Store can adopt attach.IsInlineContentType: fonoteka.go storeUpload/StorePublicFile (see 2026-10-28-fonoteka-uploads-use-disk-extension.md), the sm-user-plugin avatar writer, the sm-feedback-plugin screenshot writer.
  • Adding the disposition to objects already in a bucket stays an operator task (documented in docs/services/storage.md#deploy-note).

Closed 2026-11-05

Fixed in quick 261105-oc8: summercms.go 27c98bf. Writers that bypass attach.Store (fonoteka.go, sm-user avatar, sm-feedback screenshot) remain follow-ups.