Socket
Socket
Sign inDemoInstall

sirv

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sirv - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

6

index.js

@@ -34,3 +34,3 @@ const fs = require('fs');

function is404(res) {
function is404(req, res) {
return (res.statusCode=404,res.end());

@@ -87,3 +87,3 @@ }

let file = arr.map(x => join(dir, x)).find(fs.existsSync);
if (!file) return next ? next() : isNotFound(res);
if (!file) return next ? next() : isNotFound(req, res);

@@ -123,3 +123,3 @@ let stats = fs.statSync(file);

let data = find(pathname, extensions);
if (!data) return next ? next() : isNotFound(res);
if (!data) return next ? next() : isNotFound(req, res);

@@ -126,0 +126,0 @@ setHeaders(res, pathname, data.stats);

{
"name": "sirv",
"version": "0.3.1",
"version": "0.4.0",
"description": "The optimized & lightweight middleware for serving requests to static assets",

@@ -5,0 +5,0 @@ "repository": "lukeed/sirv",

@@ -108,3 +108,3 @@ # sirv [![Build Status](https://travis-ci.org/lukeed/sirv.svg?branch=master)](https://travis-ci.org/lukeed/sirv)

The function receives the current `res <ServerResponse>` as its only argument.
The function receives the current `req <IncomingMessage>, res <ServerResponse>` pair for as its two arguments.

@@ -111,0 +111,0 @@ > **Note:** This won't run if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description.

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