Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

express-lowercase-paths-with-status-code

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-lowercase-paths-with-status-code

An Express middleware module that will redirect user HTTP requests that contain uppercase letters, to the same URL converted to lowercase, without modifying query parameters.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Very similar to the unmaintained project express-uncapitalize, this middleware redirects any requests which contain uppercase chars to their lowercase forms. With two main changes from the original:

  • Works with all utf-8 strings in paths
  • Keeps query parameters intact

Installation

npm install express-lowercase-paths

Usage

var lowercasePaths = require("express-lowercase-paths")
app.use(lowercasePaths())

Options

Redirecting with specific status code

To redirect with a specific status code, pass the redirectStatusCode option to the middleware:

var lowercasePaths = require("express-lowercase-paths")
app.use(lowercasePaths({redirectStatusCode: 301}))

Keywords

express

FAQs

Package last updated on 03 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts