Way can't distinguish between / and %2F in a path. Thus %2F messes up the path segments.
I'd suggest to fix this by using u.EscapedPath() instead of req.URL.Path. Quoting net/url#URL:
Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the EscapedPath method, which preserves the original encoding of Path.
Way can't distinguish between
/and%2Fin a path. Thus%2Fmesses up the path segments.I'd suggest to fix this by using
u.EscapedPath()instead ofreq.URL.Path. Quoting net/url#URL: