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 2.4.1 to 3.0.0

2

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

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

@@ -52,3 +52,3 @@ # serve-handler

| [`public`](#public-boolean) | Set a sub directory to be served |
| [`cleanUrls`](#cleanurls-booleanarray) | Have `.html` and `.htm` extension stripped from paths |
| [`cleanUrls`](#cleanurls-booleanarray) | Have the `.html` extension stripped from paths |
| [`rewrites`](#rewrites-array) | Rewrite paths to different paths |

@@ -77,3 +77,3 @@ | [`redirects`](#redirects-array) | Forward paths to different paths or external URLs |

By default, all `.html` and `.htm` files can be accessed without their extension.
By default, all `.html` files can be accessed without their extension.

@@ -80,0 +80,0 @@ If one of these extensions is used at the end of a filename, it will automatically perform a redirect with status code [301](https://en.wikipedia.org/wiki/HTTP_301) to the same path, but with the extension dropped.

@@ -106,3 +106,3 @@ // Native

const defaultType = 301;
const matchHTML = /(\.html|\.htm|\/index)$/g;
const matchHTML = /(\.html|\/index)$/g;

@@ -239,4 +239,4 @@ let cleanedUrl = false;

const findRelated = async (current, relativePath, rewrittenPath, originalStat, extension = '.html') => {
const possible = rewrittenPath ? [rewrittenPath] : getPossiblePaths(relativePath, extension);
const findRelated = async (current, relativePath, rewrittenPath, originalStat) => {
const possible = rewrittenPath ? [rewrittenPath] : getPossiblePaths(relativePath, '.html');

@@ -265,9 +265,3 @@ let stats = null;

if (extension === '.htm') {
return null;
}
// At this point, no `.html` files have been found, so we
// need to check for the existance of `.htm` ones.
return findRelated(current, relativePath, rewrittenPath, originalStat, '.htm');
return null;
};

@@ -274,0 +268,0 @@

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