Socket
Book a DemoInstallSign in
Socket

github.com/stinkyfingers/simplecors

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/stinkyfingers/simplecors

v0.0.0-20200817163405-eba3985fe55d
Source
Go
Version published
Created
Source

SimpleCors

simplecors contains a single configurable Cors type and a single middlware function. It is not an exhaustive implementation. I often wind up re-writing the same 6 lines of code when implementing Cors (quickly) in dev environments and simple http server projects and grew tired of the repetition.

mux := http.NewServeMux()
cors := simplecors.DefaultCors()
mux.HandleFunc("/", cors.Middleware(func(w http.ResponseWriter, r *http.Request) {
  w.Write([]byte("success!"))
}))
http.ListenAndServe(":8080", mux)

FAQs

Package last updated on 17 Aug 2020

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.