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

Conversation

Projects
None yet
2 participants
@rexso
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Dec 16, 2016

Member

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

Member

s-ludwig commented Dec 16, 2016

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

s-ludwig added a commit that referenced this pull request Dec 19, 2016

Merge pull request #1642 from rexso/master
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