You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If SegmentTrie.lookup is called with path being "", it generates an OoB exception inside SegmentTrie.split.
This can happen legitimately when you have a reitit.ring router with a redirect-trailing-slash-handler set to strip. A request to / when no route exists for that path results in the trailing-slash handler stripping "/" to "" and looking that up in the router to see if it can redirect. That works in other routers but not in the segment router.
This might be two separate issues: the trailing-slash handler should probably not look up "" if it can never be a valid route, while segment-router should probably not break on this edge case if other routers do handle it safely.
The text was updated successfully, but these errors were encountered:
Thanks for reporting, fixed the SegmentRouter part in [metosin/reitit "0.2.13"]. The trailing-slash redirecting to "". Did a separate commit out of that. I think it's a bug too, as one could introduce a route with path "", which would get a redirect but all the ring servers add the "/ to uris, so it might go to inifinite redirect loop.
If
SegmentTrie.lookup
is called withpath
being""
, it generates an OoB exception insideSegmentTrie.split
.This can happen legitimately when you have a
reitit.ring
router with aredirect-trailing-slash-handler
set to strip. A request to/
when no route exists for that path results in the trailing-slash handler stripping"/"
to""
and looking that up in the router to see if it can redirect. That works in other routers but not in the segment router.This might be two separate issues: the trailing-slash handler should probably not look up
""
if it can never be a valid route, while segment-router should probably not break on this edge case if other routers do handle it safely.The text was updated successfully, but these errors were encountered: