From d1960fc02f465feb76234ef6ceabc7f3bf42866b Mon Sep 17 00:00:00 2001 From: francoposa Date: Sat, 26 Mar 2022 15:33:14 -0700 Subject: [PATCH 1/8] add javascript frontend examples directory with README and working axios example --- examples/javascript-frontends/README.md | 15 ++++++ .../javascript-frontends/axios/index.html | 30 ++++++++++++ examples/javascript-frontends/axios/index.js | 48 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 examples/javascript-frontends/README.md create mode 100644 examples/javascript-frontends/axios/index.html create mode 100644 examples/javascript-frontends/axios/index.js diff --git a/examples/javascript-frontends/README.md b/examples/javascript-frontends/README.md new file mode 100644 index 0000000..4eba61e --- /dev/null +++ b/examples/javascript-frontends/README.md @@ -0,0 +1,15 @@ +# JavaScript Frontends + +Examples in this directory are intended to provide basic frontend JavaScript code. +These examples are compatible with the API backend examples available in the `examples/api-backends` directory. + +In order to be compatible with any CSRF-protected backend, the JavaScript must: + +1. Be served from a domain allowed by the backend's CORS Allowed Origins configuration. + 1. `http://localhost*` for the backend examples provided +2. Use the HTTP header expected by the backend to send and receive CSRF Tokens. +The backends configure this as the Gorilla `csrf.CookieName`, +as well as the CORS Allowed Headers and Exposed Headers. + 1. `X-CSRF-Token` for the backend examples provided + 2. Note that some JavaScript HTTP clients may automatically lowercase all received headers, + so the values must be accessed with the key `"x-csrf-token"` in the frontend code. \ No newline at end of file diff --git a/examples/javascript-frontends/axios/index.html b/examples/javascript-frontends/axios/index.html new file mode 100644 index 0000000..a367f5c --- /dev/null +++ b/examples/javascript-frontends/axios/index.html @@ -0,0 +1,30 @@ + + + + + Gorilla CSRF + + + +
+

Gorilla CSRF: Axios JS Frontend

+

See Console and Network tabs of your browser's Developer Tools for further details

+
+ +
+

Get Request:

+

Full Response:

+ +

CSRF Token:

+ +
+ + +
+

Post Request:

+

Full Response:

+ +
+ + + \ No newline at end of file diff --git a/examples/javascript-frontends/axios/index.js b/examples/javascript-frontends/axios/index.js new file mode 100644 index 0000000..24f134a --- /dev/null +++ b/examples/javascript-frontends/axios/index.js @@ -0,0 +1,48 @@ +// make GET request to backend on page load in order to obtain +// a CSRF Token and load it into the Axios instance's headers +// https://github.com/axios/axios#creating-an-instance +const initializeAxiosInstance = async (url) => { + try { + let resp = await axios.get(url, {withCredentials: true}); + console.log(resp); + document.getElementById("get-request-full-response").innerHTML = JSON.stringify(resp); + + let csrfToken = parseCSRFToken(resp); + console.log(csrfToken); + document.getElementById("get-response-csrf-token").innerHTML = csrfToken; + + return axios.create({ + // withCredentials must be true to in order for the browser + // to send cookies, which are necessary for CSRF verification + withCredentials: true, + headers: {"X-CSRF-Token": csrfToken} + }); + } catch (err) { + console.log(err); + } +}; + +const post = async (axiosInstance, url) => { + try { + let resp = await axiosInstance.post(url); + console.log(resp); + document.getElementById("post-request-full-response").innerHTML = JSON.stringify(resp); + } catch (err) { + console.log(err); + } +}; + +const parseCSRFToken = (resp) => { + let csrfToken = resp.headers[csrfTokenHeader]; + if (!csrfToken) { + csrfToken = resp.headers[csrfTokenHeader.toLowerCase()]; + } + return csrfToken +} + +const url = "http://localhost:8080/api"; +const csrfTokenHeader = "X-CSRF-Token"; +initializeAxiosInstance(url) + .then(axiosInstance => { + post(axiosInstance, url); + }); From b0070c0fc08c46b90bebb8144c8ebd0476988cdf Mon Sep 17 00:00:00 2001 From: francoposa Date: Sat, 26 Mar 2022 15:41:24 -0700 Subject: [PATCH 2/8] update axios javascript frontend example to indicate behavior regarding axios headers --- examples/javascript-frontends/axios/index.html | 4 ++++ examples/javascript-frontends/axios/index.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/examples/javascript-frontends/axios/index.html b/examples/javascript-frontends/axios/index.html index a367f5c..29ac9c0 100644 --- a/examples/javascript-frontends/axios/index.html +++ b/examples/javascript-frontends/axios/index.html @@ -23,6 +23,10 @@

CSRF Token:

Post Request:

Full Response:

+

+ Note that the X-CSRF-Token value is in the Axios config.headers; + it is not a response header set by the server. +

diff --git a/examples/javascript-frontends/axios/index.js b/examples/javascript-frontends/axios/index.js index 24f134a..d931c58 100644 --- a/examples/javascript-frontends/axios/index.js +++ b/examples/javascript-frontends/axios/index.js @@ -32,6 +32,8 @@ const post = async (axiosInstance, url) => { } }; +// general-purpose func to deal with clients like Axios, +// which lowercase all headers received from the server response const parseCSRFToken = (resp) => { let csrfToken = resp.headers[csrfTokenHeader]; if (!csrfToken) { From 0f9c9fe3b8237146c3fbd8c195b6aae9f7d25414 Mon Sep 17 00:00:00 2001 From: francoposa Date: Mon, 28 Mar 2022 19:57:04 -0700 Subject: [PATCH 3/8] working gorilla/mux CORS- and CSRF-protected api backend example --- examples/api-backends/gorilla-mux/go.mod | 15 ++++++ examples/api-backends/gorilla-mux/go.sum | 12 +++++ examples/api-backends/gorilla-mux/main.go | 65 +++++++++++++++++++++++ examples/javascript-frontends/README.md | 12 ++--- 4 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 examples/api-backends/gorilla-mux/go.mod create mode 100644 examples/api-backends/gorilla-mux/go.sum create mode 100644 examples/api-backends/gorilla-mux/main.go diff --git a/examples/api-backends/gorilla-mux/go.mod b/examples/api-backends/gorilla-mux/go.mod new file mode 100644 index 0000000..339dd14 --- /dev/null +++ b/examples/api-backends/gorilla-mux/go.mod @@ -0,0 +1,15 @@ +module github.com/gorilla-mux/examples/api-backends/gorilla-mux + +go 1.17 + +require ( + github.com/gorilla/csrf v1.7.1 + github.com/gorilla/handlers v1.5.1 + github.com/gorilla/mux v1.8.0 +) + +require ( + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/gorilla/securecookie v1.1.1 // indirect + github.com/pkg/errors v0.9.1 // indirect +) diff --git a/examples/api-backends/gorilla-mux/go.sum b/examples/api-backends/gorilla-mux/go.sum new file mode 100644 index 0000000..e371b32 --- /dev/null +++ b/examples/api-backends/gorilla-mux/go.sum @@ -0,0 +1,12 @@ +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/gorilla/csrf v1.7.1 h1:Ir3o2c1/Uzj6FBxMlAUB6SivgVMy1ONXwYgXn+/aHPE= +github.com/gorilla/csrf v1.7.1/go.mod h1:+a/4tCmqhG6/w4oafeAZ9pEa3/NZOWYVbD9fV0FwIQA= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/examples/api-backends/gorilla-mux/main.go b/examples/api-backends/gorilla-mux/main.go new file mode 100644 index 0000000..e9a5f88 --- /dev/null +++ b/examples/api-backends/gorilla-mux/main.go @@ -0,0 +1,65 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + "time" + + "github.com/gorilla/csrf" + "github.com/gorilla/handlers" + "github.com/gorilla/mux" +) + +func main() { + router := mux.NewRouter() + + loggingMiddleware := func(h http.Handler) http.Handler { + return handlers.LoggingHandler(os.Stdout, h) + } + router.Use(loggingMiddleware) + + CSRFMiddleware := csrf.Protect( + []byte("place-your-32-byte-long-key-here"), + csrf.Secure(false), // false in development only! + csrf.CookieName("csrf"), + csrf.RequestHeader("X-CSRF-Token"), // Must be in CORS Allowed and Exposed Headers + ) + + APIRouter := router.PathPrefix("/api").Subrouter() + APIRouter.Use(CSRFMiddleware) + APIRouter.HandleFunc("", Get).Methods(http.MethodGet) + APIRouter.HandleFunc("", Post).Methods(http.MethodPost) + + CORSMiddleware := handlers.CORS( + handlers.AllowCredentials(), + handlers.AllowedOriginValidator( + func(origin string) bool { + return strings.HasPrefix(origin, "http://localhost") + }, + ), + handlers.AllowedHeaders([]string{"X-CSRF-Token"}), + handlers.ExposedHeaders([]string{"X-CSRF-Token"}), + ) + + server := &http.Server{ + Handler: CORSMiddleware(router), + Addr: "localhost:8080", + ReadTimeout: 60 * time.Second, + WriteTimeout: 60 * time.Second, + } + + fmt.Println("starting http server on localhost:8080") + log.Fatal(server.ListenAndServe()) +} + +func Get(w http.ResponseWriter, r *http.Request) { + w.Header().Add("X-CSRF-Token", csrf.Token(r)) + w.WriteHeader(http.StatusOK) +} + +func Post(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) +} diff --git a/examples/javascript-frontends/README.md b/examples/javascript-frontends/README.md index 4eba61e..483ad24 100644 --- a/examples/javascript-frontends/README.md +++ b/examples/javascript-frontends/README.md @@ -1,15 +1,15 @@ # JavaScript Frontends -Examples in this directory are intended to provide basic frontend JavaScript code. -These examples are compatible with the API backend examples available in the `examples/api-backends` directory. +Examples in this directory are intended to provide basic working frontend JavaScript, +compatible with the API backend examples available in the `examples/api-backends` directory. -In order to be compatible with any CSRF-protected backend, the JavaScript must: +In order to be compatible with a CSRF-protected backend, frontend clients must: 1. Be served from a domain allowed by the backend's CORS Allowed Origins configuration. 1. `http://localhost*` for the backend examples provided -2. Use the HTTP header expected by the backend to send and receive CSRF Tokens. -The backends configure this as the Gorilla `csrf.CookieName`, +2. Use the HTTP headers expected by the backend to send and receive CSRF Tokens. +The backends configure this as the Gorilla `csrf.RequestHeader`, as well as the CORS Allowed Headers and Exposed Headers. 1. `X-CSRF-Token` for the backend examples provided - 2. Note that some JavaScript HTTP clients may automatically lowercase all received headers, + 2. Note that some JavaScript HTTP clients automatically lowercase all received headers, so the values must be accessed with the key `"x-csrf-token"` in the frontend code. \ No newline at end of file From 8a1a5e26732f2fecbd924b088cf488b8169f135b Mon Sep 17 00:00:00 2001 From: francoposa Date: Tue, 29 Mar 2022 10:47:13 -0700 Subject: [PATCH 4/8] Adding a fileserver for serving frontend examples, updated example READMEs --- examples/api-backends/README.md | 11 +++++ examples/api-backends/gorilla-mux/main.go | 5 +-- examples/javascript-frontends/README.md | 22 +++++----- .../example-frontend-server/go.mod | 10 +++++ .../example-frontend-server/go.sum | 6 +++ .../example-frontend-server/main.go | 40 +++++++++++++++++++ .../{ => frontends}/axios/index.html | 0 .../{ => frontends}/axios/index.js | 0 8 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 examples/api-backends/README.md create mode 100644 examples/javascript-frontends/example-frontend-server/go.mod create mode 100644 examples/javascript-frontends/example-frontend-server/go.sum create mode 100644 examples/javascript-frontends/example-frontend-server/main.go rename examples/javascript-frontends/{ => frontends}/axios/index.html (100%) rename examples/javascript-frontends/{ => frontends}/axios/index.js (100%) diff --git a/examples/api-backends/README.md b/examples/api-backends/README.md new file mode 100644 index 0000000..c2a8eb0 --- /dev/null +++ b/examples/api-backends/README.md @@ -0,0 +1,11 @@ +# API Backends + +Examples in this directory are intended to provide basic working backend CSRF-protected APIs, +compatible with the JavaScript frontend examples available in the +[`examples/javascript-frontends`](../javascript-frontends). + +In addition to CSRF protection, these backends provide the CORS configuration required for +communicating the CSRF cookies and headers with JavaScript client code running in the browser. + +See [`examples/javascript-frontends`](../javascript-frontends/README.md) for details on CORS and +CSRF configuration compatibility requirements. diff --git a/examples/api-backends/gorilla-mux/main.go b/examples/api-backends/gorilla-mux/main.go index e9a5f88..48d0703 100644 --- a/examples/api-backends/gorilla-mux/main.go +++ b/examples/api-backends/gorilla-mux/main.go @@ -23,8 +23,7 @@ func main() { CSRFMiddleware := csrf.Protect( []byte("place-your-32-byte-long-key-here"), - csrf.Secure(false), // false in development only! - csrf.CookieName("csrf"), + csrf.Secure(false), // false in development only! csrf.RequestHeader("X-CSRF-Token"), // Must be in CORS Allowed and Exposed Headers ) @@ -52,7 +51,7 @@ func main() { } fmt.Println("starting http server on localhost:8080") - log.Fatal(server.ListenAndServe()) + log.Panic(server.ListenAndServe()) } func Get(w http.ResponseWriter, r *http.Request) { diff --git a/examples/javascript-frontends/README.md b/examples/javascript-frontends/README.md index 483ad24..02a1de4 100644 --- a/examples/javascript-frontends/README.md +++ b/examples/javascript-frontends/README.md @@ -1,15 +1,19 @@ # JavaScript Frontends -Examples in this directory are intended to provide basic working frontend JavaScript, -compatible with the API backend examples available in the `examples/api-backends` directory. +Examples in this directory are intended to provide basic working frontend JavaScript, compatible +with the API backend examples available in the [`examples/api-backends`](../api-backends). + +## CSRF and CORS compatibility In order to be compatible with a CSRF-protected backend, frontend clients must: 1. Be served from a domain allowed by the backend's CORS Allowed Origins configuration. - 1. `http://localhost*` for the backend examples provided -2. Use the HTTP headers expected by the backend to send and receive CSRF Tokens. -The backends configure this as the Gorilla `csrf.RequestHeader`, -as well as the CORS Allowed Headers and Exposed Headers. - 1. `X-CSRF-Token` for the backend examples provided - 2. Note that some JavaScript HTTP clients automatically lowercase all received headers, - so the values must be accessed with the key `"x-csrf-token"` in the frontend code. \ No newline at end of file + 1. `http://localhost*` for the backend examples provided + 2. An example server to serve the HTML and JavaScript for the frontend examples from localhost is included in + [`examples/javascript-frontends/example-frontend-server`](../javascript-frontends/example-frontend-server) +3. Use the HTTP headers expected by the backend to send and receive CSRF Tokens. + The backends configure this as the Gorilla `csrf.RequestHeader`, + as well as the CORS Allowed Headers and Exposed Headers. + 1. `X-CSRF-Token` for the backend examples provided + 2. Note that some JavaScript HTTP clients automatically lowercase all received headers, + so the values must be accessed with the key `"x-csrf-token"` in the frontend code. diff --git a/examples/javascript-frontends/example-frontend-server/go.mod b/examples/javascript-frontends/example-frontend-server/go.mod new file mode 100644 index 0000000..7114f5e --- /dev/null +++ b/examples/javascript-frontends/example-frontend-server/go.mod @@ -0,0 +1,10 @@ +module github.com/gorilla-mux/examples/javascript-frontends/example-frontend-server + +go 1.17 + +require ( + github.com/gorilla/handlers v1.5.1 + github.com/gorilla/mux v1.8.0 +) + +require github.com/felixge/httpsnoop v1.0.1 // indirect diff --git a/examples/javascript-frontends/example-frontend-server/go.sum b/examples/javascript-frontends/example-frontend-server/go.sum new file mode 100644 index 0000000..daba3c0 --- /dev/null +++ b/examples/javascript-frontends/example-frontend-server/go.sum @@ -0,0 +1,6 @@ +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= diff --git a/examples/javascript-frontends/example-frontend-server/main.go b/examples/javascript-frontends/example-frontend-server/main.go new file mode 100644 index 0000000..8babeb0 --- /dev/null +++ b/examples/javascript-frontends/example-frontend-server/main.go @@ -0,0 +1,40 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "time" + + "github.com/gorilla/handlers" + "github.com/gorilla/mux" +) + +func main() { + router := mux.NewRouter() + + loggingMiddleware := func(h http.Handler) http.Handler { + return handlers.LoggingHandler(os.Stdout, h) + } + router.Use(loggingMiddleware) + + wd, err := os.Getwd() + if err != nil { + log.Panic(err) + } + // change this directory to point at a different Javascript frontend to serve + httpStaticAssetsDir := http.Dir(fmt.Sprintf("%s/../frontends/axios/", wd)) + + router.PathPrefix("/").Handler(http.FileServer(httpStaticAssetsDir)) + + server := &http.Server{ + Handler: router, + Addr: "localhost:8081", + ReadTimeout: 60 * time.Second, + WriteTimeout: 60 * time.Second, + } + + fmt.Println("starting http server on localhost:8081") + log.Panic(server.ListenAndServe()) +} diff --git a/examples/javascript-frontends/axios/index.html b/examples/javascript-frontends/frontends/axios/index.html similarity index 100% rename from examples/javascript-frontends/axios/index.html rename to examples/javascript-frontends/frontends/axios/index.html diff --git a/examples/javascript-frontends/axios/index.js b/examples/javascript-frontends/frontends/axios/index.js similarity index 100% rename from examples/javascript-frontends/axios/index.js rename to examples/javascript-frontends/frontends/axios/index.js From a8b837700721068f8abdbbc23e43558d87a113f0 Mon Sep 17 00:00:00 2001 From: francoposa Date: Thu, 17 Aug 2023 11:15:41 -0700 Subject: [PATCH 5/8] update examples to go 1.20 --- examples/api-backends/gorilla-mux/go.mod | 4 ++-- examples/api-backends/gorilla-mux/go.sum | 3 ++- examples/javascript-frontends/example-frontend-server/go.mod | 4 ++-- examples/javascript-frontends/example-frontend-server/go.sum | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/api-backends/gorilla-mux/go.mod b/examples/api-backends/gorilla-mux/go.mod index 339dd14..fd2079c 100644 --- a/examples/api-backends/gorilla-mux/go.mod +++ b/examples/api-backends/gorilla-mux/go.mod @@ -1,6 +1,6 @@ module github.com/gorilla-mux/examples/api-backends/gorilla-mux -go 1.17 +go 1.20 require ( github.com/gorilla/csrf v1.7.1 @@ -9,7 +9,7 @@ require ( ) require ( - github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/gorilla/securecookie v1.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect ) diff --git a/examples/api-backends/gorilla-mux/go.sum b/examples/api-backends/gorilla-mux/go.sum index e371b32..8271f7f 100644 --- a/examples/api-backends/gorilla-mux/go.sum +++ b/examples/api-backends/gorilla-mux/go.sum @@ -1,5 +1,6 @@ -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/gorilla/csrf v1.7.1 h1:Ir3o2c1/Uzj6FBxMlAUB6SivgVMy1ONXwYgXn+/aHPE= github.com/gorilla/csrf v1.7.1/go.mod h1:+a/4tCmqhG6/w4oafeAZ9pEa3/NZOWYVbD9fV0FwIQA= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= diff --git a/examples/javascript-frontends/example-frontend-server/go.mod b/examples/javascript-frontends/example-frontend-server/go.mod index 7114f5e..af48442 100644 --- a/examples/javascript-frontends/example-frontend-server/go.mod +++ b/examples/javascript-frontends/example-frontend-server/go.mod @@ -1,10 +1,10 @@ module github.com/gorilla-mux/examples/javascript-frontends/example-frontend-server -go 1.17 +go 1.20 require ( github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 ) -require github.com/felixge/httpsnoop v1.0.1 // indirect +require github.com/felixge/httpsnoop v1.0.3 // indirect diff --git a/examples/javascript-frontends/example-frontend-server/go.sum b/examples/javascript-frontends/example-frontend-server/go.sum index daba3c0..1e9fd4d 100644 --- a/examples/javascript-frontends/example-frontend-server/go.sum +++ b/examples/javascript-frontends/example-frontend-server/go.sum @@ -1,5 +1,6 @@ -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= From 84193d542bcd7aa0e4a6e86e819f50caadc8d128 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Thu, 17 Aug 2023 14:52:37 -0400 Subject: [PATCH 6/8] Update go.mod --- examples/api-backends/gorilla-mux/go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/api-backends/gorilla-mux/go.mod b/examples/api-backends/gorilla-mux/go.mod index fd2079c..17e266f 100644 --- a/examples/api-backends/gorilla-mux/go.mod +++ b/examples/api-backends/gorilla-mux/go.mod @@ -1,3 +1,5 @@ +// +build ignore + module github.com/gorilla-mux/examples/api-backends/gorilla-mux go 1.20 From f0f2324e13ba01a5e9f312805fbd18b4d6f3f5c1 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Thu, 17 Aug 2023 14:52:58 -0400 Subject: [PATCH 7/8] Update main.go --- examples/api-backends/gorilla-mux/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/api-backends/gorilla-mux/main.go b/examples/api-backends/gorilla-mux/main.go index 48d0703..849549a 100644 --- a/examples/api-backends/gorilla-mux/main.go +++ b/examples/api-backends/gorilla-mux/main.go @@ -1,3 +1,5 @@ +// +build ignore + package main import ( From 226480b970f12d1743fa7a9003c5dfafa99eabd2 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Thu, 17 Aug 2023 14:53:28 -0400 Subject: [PATCH 8/8] Update main.go --- examples/javascript-frontends/example-frontend-server/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/javascript-frontends/example-frontend-server/main.go b/examples/javascript-frontends/example-frontend-server/main.go index 8babeb0..6cac20b 100644 --- a/examples/javascript-frontends/example-frontend-server/main.go +++ b/examples/javascript-frontends/example-frontend-server/main.go @@ -1,3 +1,5 @@ +// +build ignore + package main import (