New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-plugin-default-api-gateway-cors-response

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

serverless-plugin-default-api-gateway-cors-response

A Serverless plugin that injects default cors headers

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
148
decreased by-39.84%
Maintainers
1
Weekly downloads
 
Created
Source

Default API Gateway Cors Response

A Serverless plugin that injects default cors headers

Purpose

When you enable cors inside the serverless.yml file, you're allowing those headers to be passed though Api Gateway, it does not set them.

Generally your application will return the cors related headers. However, in the event that the application can't set the headers (for example, when an authorisation lambda rejects), then the headers won't be set.

This package monkey-patches the Default Api Gateway Response for 4xx and 5xx errors to the serverless resources.

Requirements

  • Node.js v14

Usage

Install the package as a dev dependency

$ npm install -D serverless-plugin-default-api-gateway-cors-response

Include the plugin in your serverless.yml

plugins:
  - 'serverless-plugin-default-api-gateway-cors-response'

Configure the options (optional)

custom:
  default-api-gateway-cors-response:
    origin: '*'
    headers:
      - 'Accept'
      - 'Authorization'
    statusCodeRanges:
      - '4XX'
      - '5XX'

Installation

$ git clone git@github.com:lemonJS/serverless-plugin-default-api-gateway-cors-response.git
$ cd serverless-plugin-default-api-gateway-cors-response
$ npm install

Running the tests

$ npm test 

Generating a build

$ npm run build

FAQs

Package last updated on 10 Mar 2021

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