<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 12:05 PM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Thanks, for basic 404 it indeed works.<br>
However, I discovered at least one scenario where it does not:<br></blockquote><div><br></div><div>Thanks for pointing that out.</div><div>The reason is that when dispatching errors we do not pass through the middleware stack again, so RoutesMiddleware is not executed again and the routes dict remains the same as before. This causes our RootController to dispatch it again to the same route as before which leads to a 404 error again.</div><div><br></div><div>I provided a work-around inĀ <a href="https://bitbucket.org/_amol_/kallithea-tg/commits/5ec7001cd47dece91580d8d533bacf3f0ab0d990">https://bitbucket.org/_amol_/kallithea-tg/commits/5ec7001cd47dece91580d8d533bacf3f0ab0d990</a> but probably the "correct" solution would be to remove RoutesMiddleware and perform the route resolution inside RootController so that the route is resolved every time we perform a dispatch and not only when receiving a request from the WSGI server.</div></div></div></div>