Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
unrolled committed Sep 6, 2022
1 parent a0273b7 commit ff75cac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package main
import (
"net/http"

"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -153,7 +153,7 @@ import (
"log"
"net/http"

"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -186,9 +186,7 @@ The STS header will only be sent on verified HTTPS connections (and when `IsDeve
* The `preload` flag is required for domain inclusion in Chrome's [preload](https://hstspreload.appspot.com/) list.

### Content Security Policy
If you need dynamic support for CSP while using Websockets, check out this other middleware [awakenetworks/csp](https://github.com/awakenetworks/csp).

Otherwise you can use the CSP Builder to create a CSP in a safer way:
You can utilize the CSP Builder to create your policies:

~~~ go
import (
Expand Down Expand Up @@ -220,7 +218,7 @@ import (
"net/http"

"github.com/pressly/chi"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand Down Expand Up @@ -248,7 +246,7 @@ import (
"net/http"

"github.com/labstack/echo"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand All @@ -273,7 +271,7 @@ package main

import (
"github.com/gin-gonic/gin"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand Down Expand Up @@ -316,7 +314,7 @@ package main
import (
"net/http"

"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
)
Expand All @@ -341,7 +339,7 @@ package main

import (
"github.com/kataras/iris/v12"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand Down Expand Up @@ -382,7 +380,7 @@ import (
"net/http"

"github.com/gorilla/mux"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand All @@ -407,7 +405,7 @@ import (
"net/http"

"github.com/urfave/negroni"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Package secure is an HTTP middleware for Go that facilitates some quick security
import (
"net/http"
"github.com/unrolled/secure" // or "gopkg.in/unrolled/secure.v1"
"github.com/unrolled/secure"
)
var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit ff75cac

Please sign in to comment.