title: How to implement case insensitive URL matching using gorilla mux
body: <p>I need to implement case insensitive URL matching in gorilla mux as <a href="https://grokbase.com/p/gg/golang-nuts/1337v1v6r7/go-nuts-http-handlefunc-case-insensitive-path-match-default-match" rel="nofollow noreferrer">it is done here for built in mux</a></p>
  
  <p>I tried to achieve the same using middle-ware like this</p>
  
  <pre><code>router := mux.NewRouter()
  router.Use(srv.GetCaseMiddleware())
  
  //GetCaseMiddleware middleware to make match URL case insensitive
  func (srv *Server) GetCaseMiddleware() (w mux.MiddlewareFunc) {
      var middleware mux.MiddlewareFunc = func(next http.Handler) http.Handler {
          return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
              r.URL.Path = strings.ToLower(r.URL.Path)
              next.ServeHTTP(w, r)
          })
      }
      return middleware
  }
  </code></pre>
  
  <p>but still it throws 404 if URL case is changed,is there any way to implement it using gorilla-mux</p>