I have the following small program. It does not accept encoded double slashes (%2F%2F) even after using SkipClean while single encoded slash works fine.
Could someone please suggest what is going wrong here?
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter().SkipClean(true).UseEncodedPath()
r.HandleFunc("/", hiHandler)
r.HandleFunc("/hi{*}", hiHandler).Methods("GET")
http.Handle("/", r)
http.ListenAndServe(":10801", nil)
}
func hiHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello world!")
}
#curl http://localhost:10801/hi%2Fds => this works
#curl http://localhost:10801/hi%2F%2Fds => this does not. Gives Moved Permanently error.