I haven't played around with it yet, but have you tried to separately register /something/ ?
mux := http.NewServeMux() mux.HandleFunc("/something/", func...) mux.HandleFunc("/something/{id}/{$}", func...) On Wednesday, February 7, 2024 at 1:21:00 PM UTC-8 Péter Szarvas wrote: > Hello, > > I noticed if you set up a route like /something/{id}/{$}, it results in an > infinite loop if I navigate to /someting/ (with the trailing slash). I got > a redirect to Location: /something/, and so on. Finally the page breaks > after multiple rounds. > > Example: > mux := http.NewServeMux() > mux.HandleFunc("/something/{id}/{$}", func...)) > > Should I raise and issue or am I doing something wrong here? > > Thanks, > Peter > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c4389c9a-6d46-4931-9ace-c4e77b67b00bn%40googlegroups.com.