swifter icon indicating copy to clipboard operation
swifter copied to clipboard

`shareFilesFromDirectory` HTTP response does not include relevant HTTP headers

Open davidfmiller opened this issue 8 years ago • 3 comments

The HTTP response from a route that is served via the shareFilesFromDirectory function looks like so:

HTTP/1.1 200 OK
Server: Swifter [version]

[response-content-goes-here]

At a minimum there should be a Content-Type, Content-Length, Last-Modified, Date, and probably a Connection: close header included.

davidfmiller avatar Dec 19 '17 19:12 davidfmiller

+1 for this. What did you end up doing @davidfmiller ?

lprhodes avatar Feb 14 '18 21:02 lprhodes

I hacked together a solution. I can put it into a PR if there's a chance it would go anywhere.

davidfmiller avatar Feb 14 '18 23:02 davidfmiller

shareFilesFromDirectory returns the "Content-Type": mimeType when the fileRelativePath exist. otherwise, the Headers are empty for a 200. I think it's worth it to have more information about the file, could you create a PR with your proposal ?

Vkt0r avatar Nov 05 '18 00:11 Vkt0r