I think you will struggle to access connection when in `PageIterator` and I think the solution is ok. I am not sure why are you escaping `path_prefix` when comparing with path? I think it would be good to add some tests around this bit to ensure in future this doesn't fall apart. Apart from that great stuff.