When allowing users to download files from my application, I manually set the "Content-Disposition" as "inline" or "attachment" depending on the file type. For example, I set it to "inline" for pdf files and "attachment" for html files.
Is there a way to automatically determine the value of "Content-Disposition" in express based on the file type?
If no "Content-Disposition" header is sent, does the request default to "Content-Disposition: inline"? Or is there more to it?
If browsers automatically try to preview/executethe files (as mentioned in point 2), what are the security implications of allowing downloads of html files that may contain javascript?