Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect explicitly set Content-Type in sendFile #1642

Merged
merged 1 commit into from
Dec 16, 2016
Merged

Conversation

rexso
Copy link
Contributor

@rexso rexso commented Dec 16, 2016

Currently when using sendFile, the Content-Type header is automatically set based on file extension. While this default behaviour is fine, the problem is that the header is overwritten if already explicitly set.

In my case, files are not stored using any extension, so all files are treated as application/octet-stream. I have the correct media type stored elsewhere, and it would be nice if I could manually specify this, without having the header overwritten internally.

@s-ludwig
Copy link
Member

Thanks, definitely makes sense! In the current version, you could also use the preWriteCallback to explicitly override the content type header.

@s-ludwig s-ludwig merged commit e580c1b into vibe-d:master Dec 16, 2016
s-ludwig added a commit that referenced this pull request Dec 19, 2016
Respect explicitly set Content-Type in sendFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants