emicklei / go-restful

package for building REST-style Web Services using Go
MIT License
5.03k stars 690 forks source link

Questions about WebService Path #530

Closed 10196 closed 1 year ago

10196 commented 1 year ago

When adding a route using WebService.Path("/example") and WebService.GET(""), I expect the access link to be "... /example", but actually I have to access "... /example/".

I don't think the "/" at the end is necessary, I suggest optimizing the concatPath function by not adding a "/" at the end when path2 is "".

Version: v3.10.0

Thanks.

emicklei commented 1 year ago

thank you for reporting this. The slash is not needed. I will have a look again

emicklei commented 1 year ago

@10196 please have a look at the examples in /examples/issue519. The latest version is 3.10.2