Socket
Book a DemoInstallSign in
Socket

github.com/devopsfaith/krakend-cors/v2

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/devopsfaith/krakend-cors/v2

v2.1.5
Source
Go
Version published
Created
Source

Go Report Card GoDoc

KrakenD CORS

A set of building blocks for instrumenting KrakenD gateways

Available flavours

  • mux Mux based handlers
  • gin Gin based handlers

Check the tests and the documentation for more details

Configuration

You need to add an ExtraConfig section to the configuration to enable the CORS middleware. At least one option should be defined.

  • allow_origins list of strings (you can also use a wildcard, leaving it empty allows all origins too)
  • allow_headers list of strings
  • allow_methods list of strings
  • expose_headers list of strings
  • allow_credentials bool
  • max_age duration (Ex: "12h", "5m", "3600s", ...)

Configuration Example

  "extra_config": {
    "github_com/devopsfaith/krakend-cors": {
      "allow_origins": [ "http://foobar.com" ],
      "allow_methods": [ "POST", "GET"],
      "max_age": "12h"
    }
  }

or leave the defaults (the defaults allows all origins):

"extra_config": {
  "github_com/devopsfaith/krakend-cors": {
    "allow_origins": []
  }
}

FAQs

Package last updated on 20 May 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.