Socket
Socket
Sign inDemoInstall

accepts-ext

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    accepts-ext

Express middleware to turn file extensions into Accept headers


Version published
Weekly downloads
2
Maintainers
1
Install size
220 kB
Created
Weekly downloads
 

Readme

Source

accepts-ext

This module is express middleware to parse URLs containing file extensions, set the Accept header accordingly, and remove the extension.

I.e., the following request:

GET /widgets.json

becomes:

GET /widgets
Accept: application/json

This is useful in sitations where the it's easier to use a file extension than set headers, such as in a download link.

Installation

$ npm install --save accepts-ext

Usage

import * as acceptsExt from 'accepts-ext'

const app = express();
// ...
app.use(acceptsExt);

Keywords

FAQs

Last updated on 20 Dec 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc