Registry / web-framework / unrolled-secure

unrolled-secure

JSON →
library1.17.0gogounverified

Package secure is an HTTP middleware for Go that facilitates some quick security wins.

go get github.com/unrolled/secure
INSTALL
IMPORT
SIG · UNROLLED-SECURE
U
unrolled-secure
web-frameworkgov1.17.0
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.

secure
github.com/unrolled/secure

Creates a secure HTTP middleware with allowed hosts.

package main import ( "net/http" "github.com/unrolled/secure" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, secure world!")) }) handler := secure.New(secure.Options{ AllowedHosts: []string{"example.com"}, }).Handler(mux) http.ListenAndServe(":8080", handler) }
Debug
Known issues

No known issues recorded.

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

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
unrolled-secure — go get unrolled-secure · libregistry