express-compiless
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -13,9 +13,6 @@ var Path = require('path'), | ||
res.hijack(function (err, res) { | ||
if (res.statusCode !== 200) { | ||
return res.unhijack(true); | ||
} | ||
var contentType = res.getHeader('Content-Type'), | ||
matchContentType = contentType && contentType.match(/^text\/less(?:;\s*charset=([a-z0-9\-]+))?$/i); | ||
// The mime module doesn't support less yet, so we fall back: | ||
if (matchContentType || contentType === 'application/octet-stream' && /\.less(?:\?.*)?$/.test(req.url)) { | ||
if (matchContentType || /\.less(?:\?.*)?$/.test(req.url)) { | ||
// If there's an ETag, make sure it's different from the original one so the downstream middleware | ||
@@ -36,2 +33,5 @@ // won't reply with a false positive 304 on the same URL after compiless has been enabled or disabled: | ||
}).on('end', function () { | ||
if (!chunks.length) { | ||
return res.send(res.statusCode); | ||
} | ||
var lessText = Buffer.concat(chunks).toString('utf-8'), // No other charsets are really relevant, right? | ||
@@ -38,0 +38,0 @@ baseDir = Path.resolve(options.root, req.url.replace(/\/[^\/]*(?:\?.*)?$/, '/').substr(1)), |
{ | ||
"name": "express-compiless", | ||
"version": "0.0.1", | ||
"description": "Middleware that compiles less files to css on the way out", | ||
"version": "0.0.2", | ||
"description": "Express middleware that compiles less files to css on the way out.", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8364