On second glance, we're doing the redirect that's triggering this in Javascript. Rather than moving middleware, we should be able to just add the slash there and prevent the whole thing.