Skip to content

Allow * and : in path segments.

Compare
Choose a tag to compare
@dimfeld dimfeld released this 31 Mar 20:22
· 68 commits to master since this release

The router now allows path segments containing asterisks and colons that are not wildcards. A * or : at the beginning of a path segment must be backslash escaped, like so: router.GET("\\*asteriskpath", handler). The backslash should not be included if it occurs anywhere else in the path, e.g. router.GET("aaa*bbb", handler) as it only checks at the beginning.

Breaking Changes

  • The router no longer panics if you add a path segment containing : or * in the middle of the segment.
  • Path segments starting with two backslashes will be unescaped to start with a single backslash. That is, router.GET("\\\\abc") should now be router.GET("\\\\\\abc").