I'm using gorilla/mux
inside a Golang application to retrieve variables out of my routes, like so:
func main() {
router := mux.NewRouter()
router.HandleFunc("/items/{name}", itemHandler)
log.Fatal(http.ListenAndServe(":5000", router)
}
func itemHandler(w http.ResponsWriter, r *http.Request) {
name := mux.Vars(r)["name"]
fmt.Println("name is: ", name)
}
If I navigate to /items/super%20duper
on my local VM the console output is name is: super duper
, as I would expect. But when I run this on our Elastic Beanstalk instance and go to the same URL the console output is name is: super%20duper
.
We tried changing the proxy_pass
entry in the nginx config thinking maybe nginx was not passing the request URI exactly as received, but that had no effect.
If anyone else has seen the same issue I would love to know how you solved it.