Socket
Socket
Sign inDemoInstall

serve-handler

Package Overview
Dependencies
18
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.5.0 to 3.6.0

2

package.json
{
"name": "serve-handler",
"version": "3.5.0",
"version": "3.6.0",
"description": "The routing foundation of `serve` and static deployments on Now",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -185,2 +185,4 @@ # serve-handler

If you define the `ETag` header for a path, the handler will automatically reply with status code `304` for that path if a request comes in with a matching `If-None-Match` header.
**NOTE:** The paths can only contain globs that are matched using [minimatch](https://github.com/isaacs/minimatch).

@@ -187,0 +189,0 @@

@@ -643,4 +643,17 @@ // Native

// We need to check for `headers.ETag` being truthy first, otherwise it will
// match `undefined` being equal to `undefined`, which is true.
//
// Checking for `undefined` and `null` is also important, because `Range` can be `0`.
//
// eslint-disable-next-line no-eq-null
if (request.headers.range == null && headers.ETag && headers.ETag === request.headers['if-none-match']) {
response.statusCode = 304;
response.end();
return;
}
response.writeHead(response.statusCode || 200, headers);
stream.pipe(response);
};
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc