diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-12-28 21:18:36 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-12-28 21:18:36 +0000 |
commit | 73ef85bc5db590c22689e11be20737a3dd88168f (patch) | |
tree | fe393a6f0776bca1889b2113ab341a2922e25d10 /vendor/github.com/gorilla/csrf | |
parent | 9e573e571fe878ed32947cae5a6d43cb5d72d3bb (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/gorilla/csrf')
-rw-r--r-- | vendor/github.com/gorilla/csrf/README.md | 2 | ||||
-rw-r--r-- | vendor/github.com/gorilla/csrf/csrf.go | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/vendor/github.com/gorilla/csrf/README.md b/vendor/github.com/gorilla/csrf/README.md index daa3c87..8cad716 100644 --- a/vendor/github.com/gorilla/csrf/README.md +++ b/vendor/github.com/gorilla/csrf/README.md @@ -130,7 +130,7 @@ func main() { r := mux.NewRouter() api := r.PathPrefix("/api").Subrouter() - api.HandleFunc("/user/:id", GetUser).Methods("GET") + api.HandleFunc("/user/{id}", GetUser).Methods("GET") http.ListenAndServe(":8000", csrf.Protect([]byte("32-byte-long-auth-key"))(r)) diff --git a/vendor/github.com/gorilla/csrf/csrf.go b/vendor/github.com/gorilla/csrf/csrf.go index 926be23..cc7878f 100644 --- a/vendor/github.com/gorilla/csrf/csrf.go +++ b/vendor/github.com/gorilla/csrf/csrf.go @@ -89,21 +89,25 @@ type options struct { // package main // // import ( -// "github.com/elithrar/protect" +// "html/template" +// +// "github.com/gorilla/csrf" // "github.com/gorilla/mux" // ) // +// var t = template.Must(template.New("signup_form.tmpl").Parse(form)) +// // func main() { -// r := mux.NewRouter() +// r := mux.NewRouter() // -// mux.HandlerFunc("/signup", GetSignupForm) -// // POST requests without a valid token will return a HTTP 403 Forbidden. -// mux.HandlerFunc("/signup/post", PostSignupForm) +// r.HandleFunc("/signup", GetSignupForm) +// // POST requests without a valid token will return a HTTP 403 Forbidden. +// r.HandleFunc("/signup/post", PostSignupForm) // -// // Add the middleware to your router. -// http.ListenAndServe(":8000", -// // Note that the authentication key provided should be 32 bytes -// // long and persist across application restarts. +// // Add the middleware to your router. +// http.ListenAndServe(":8000", +// // Note that the authentication key provided should be 32 bytes +// // long and persist across application restarts. // csrf.Protect([]byte("32-byte-long-auth-key"))(r)) // } // |