Socket
Socket
Sign inDemoInstall

koa-override

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-override

method override middleware for koa


Version published
Weekly downloads
23K
increased by9.69%
Maintainers
0
Weekly downloads
 
Created
Source

koa-override

NPM version npm download CI Coverage

Method override middleware. Let you use HTTP verbs such as PUT or DELETE in places where the client doesn't support it.

Refactor from koa-override-method#5

Install

npm install koa-override --save

Usage

import bodyParser from 'koa-bodyparser';
import override from 'koa-override';

app.use(bodyParser());
app.use(override());

API

const mw = override([options])

If body exists, check body._method first. Otherwise check X-HTTP-Method-Override header.

If there is no override parameter, then it's simply this.request.method. You shouldn't use this unless you know you're using override.

  • options.allowedMethods = [ 'POST' ] Only allowed override method on POST request.

License

MIT

Contributors

Contributors

Made with contributors-img.

Keywords

FAQs

Package last updated on 23 Jun 2024

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

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