router icon indicating copy to clipboard operation
router copied to clipboard

how to support path with and without trailing slash ?

Open peczenyj opened this issue 8 months ago • 3 comments

I have a very restrictive requirement

I need to support path likes

/foo /foo/

without redirect from one form to the other ( in other words, the last trailing slash should be ignored )

https://github.com/buaazp/fasthttprouter works fine for this, but fasthttp/router panics

panic: a handler is already registered for path '/stream/'

goroutine 1 [running]:
github.com/fasthttp/router/radix.(*Tree).Add(0xc0003ee640, {0xc000120540, 0x8}, 0xc0003ed110)

how can I achieve it?

peczenyj avatar Oct 30 '23 16:10 peczenyj

@savsgio any idea?

peczenyj avatar May 05 '24 20:05 peczenyj