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

Serving SVGZ static files #1350

Closed
Voronchuk opened this issue Jan 28, 2014 · 2 comments
Closed

Serving SVGZ static files #1350

Voronchuk opened this issue Jan 28, 2014 · 2 comments

Comments

@Voronchuk
Copy link

Any idea how to add Content-Encoding header for static SVGZ files in assets without hacking connect in global Sailsjs module?

More about this trouble: senchalabs/connect#477

@sgress454
Copy link
Member

Note: In the future, please ask questions like this on Google Groups or StackOverflow!

You can do this with a route:

// config/routes.js
'/*.svgz': function(req, res, next) {res.header('Content-Encoding','svgz'); next();}

For anything more complicated, it's best to put the code inside of a service, but for this one-liner it's fine to just leave it in routes.js.

@Voronchuk
Copy link
Author

Will try it, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants