`miniserve` currently does not support a way to override content-disposition headers
Author: ask4fusoraCreated May 5, 2026Updated Jun 29, 2026
Hi, in some cases, I would like to serve a single file.pdf.
miniserve file.pdf -p <port>To serve that without requiring the users to automatically download the pdf file, I would need to override the Content-Disposition header to inline. But currently, miniserve hard code that header to attachment.
╭───┬─────────────────────┬───────────────────────────────────╮
│ # │ name │ value │
├───┼─────────────────────┼───────────────────────────────────┤
│ 0 │ content-length │ 786257 │
│ 1 │ last-modified │ Tue, 05 May 2026 16:21:59 GMT │
│ 2 │ etag │ "0:bff51:69fa1927:1046a108" │
│ 3 │ content-type │ application/pdf │
│ 4 │ content-disposition │ attachment; filename="report.pdf" │
│ 5 │ accept-ranges │ bytes │
│ 6 │ date │ Tue, 05 May 2026 16:22:42 GMT │
╰───┴─────────────────────┴───────────────────────────────────╯I think the "headers can not be override, if they are previously set" seems intended, but, in some cases, I really need the override capability.
Can we work on a compensation?
Source: svenstaro/miniserve