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

how to override mime type for some file extensions? #176

Open
futurist opened this issue Jan 1, 2016 · 2 comments
Open

how to override mime type for some file extensions? #176

futurist opened this issue Jan 1, 2016 · 2 comments

Comments

@futurist
Copy link

futurist commented Jan 1, 2016

want to change some of the file's mime type, is there any api? or just interpolate node response?

@leviwheatcroft
Copy link

Currently no.. but PR #184 would allow something like this:

var file = new static.Server('./public');

require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        response.setHeader('Content-Type', 'text/html') // explicitly override content type here
        file.serve(request, response);
    }).resume();
}).listen(8080);

@leviwheatcroft
Copy link

Actually this issue is a dupe of #169

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

No branches or pull requests

2 participants