Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-compiless

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-compiless - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

8

lib/index.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc