Registry / web-framework / rs-cors

rs-cors

JSON →
library1.11.1gogounverified

Package cors is a net/http handler to handle CORS related requests as defined by the W3C specification.

go get github.com/rs/cors
INSTALL
IMPORT
SIG · RS-CORS
R
rs-cors
web-frameworkgov1.11.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cors
github.com/rs/cors

Wraps a handler with CORS middleware allowing specific origin.

package main import ( "net/http" "github.com/rs/cors" ) func main() { h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, World!")) }) c := cors.New(cors.Options{ AllowedOrigins: []string{"https://example.com"}, }) http.ListenAndServe(":8080", c.Handler(h)) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.11.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
rs-cors — go get rs-cors · libregistry