Socket
Socket
Sign inDemoInstall

ecstatic

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecstatic - npm Package Compare versions

Comparing version 4.1.2 to 4.1.4

.github/workflows/npmpublish.yml

17

lib/ecstatic.js

@@ -35,2 +35,9 @@ #! /usr/bin/env node

// eslint-disable-next-line no-control-regex
const nonUrlSafeCharsRgx = /[\x00-\x1F\x7F-\uFFFF]+/g;
function ensureUriEncoded(text) {
return String(text).replace(nonUrlSafeCharsRgx, encodeURIComponent);
}
// Check to see if we should try to compress a file with gzip.

@@ -168,3 +175,4 @@ function shouldCompressGzip(req) {

return false;
} else if (!opts.weakCompare && (clientEtag !== serverEtag || clientEtag.indexOf('W/') === 0)) {
}
if (!opts.weakCompare && (clientEtag !== serverEtag || clientEtag.indexOf('W/') === 0)) {
return false;

@@ -379,4 +387,6 @@ }

// Try to serve default ./404.html
const rawUrl = (handleError ? `/${path.join(baseDir, `404.${defaultExt}`)}` : req.url);
const encodedUrl = ensureUriEncoded(rawUrl);
middleware({
url: (handleError ? `/${path.join(baseDir, `404.${defaultExt}`)}` : req.url),
url: encodedUrl,
headers: req.headers,

@@ -399,3 +409,4 @@ statusCode: 404,

const q = parsed.query ? `?${parsed.query}` : '';
res.setHeader('location', `${parsed.pathname}/${q}`);
const d = `${parsed.pathname}/${q}`;
res.setHeader('location', ensureUriEncoded(d));
res.end();

@@ -402,0 +413,0 @@ return;

2

package.json

@@ -5,3 +5,3 @@ {

"description": "A simple static file server middleware",
"version": "4.1.2",
"version": "4.1.4",
"homepage": "https://github.com/jfhbrook/node-ecstatic",

@@ -8,0 +8,0 @@ "repository": {

@@ -0,1 +1,5 @@

# THIS PROJECT IS UNMAINTAINED AND DEPRECATED
Please use something else. See: https://github.com/jfhbrook/node-ecstatic/issues/259
# Ecstatic [![build status](https://secure.travis-ci.org/jfhbrook/node-ecstatic.png)](http://travis-ci.org/jfhbrook/node-ecstatic) [![codecov.io](https://codecov.io/github/jfhbrook/node-ecstatic/coverage.svg?branch=master)](https://codecov.io/github/jfhbrook/node-ecstatic?branch=master)

@@ -2,0 +6,0 @@

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