Dotted urls may confuse goweb parameters
coredump opened this issue · 2 comments
coredump commented
When using dotted urls, like for example:
http://host/whois/10.0.0.1
and capturing it with a Map("/whois/{ip}...")
the captured variable only gets the first part, ignoring anything after the first dot.
matryer commented
This is because Goweb cares about file extensions. So it leaves you with a few options:
- don't use the
PathParam
feature, instead, parse the request path yourself - add a segment after the IP Address, this works:
whois/10.0.0.1/something
- the value would be the full IP, because Goweb knows the dots aren't part of a file extension
coredump commented
Ok thanks, I will proceed parsing the path myself.