asp.net mvc - Orchard CMS continues executing request after permanent redirect from IActionFilter -
we have website uses orchard cms , we've written "redirectfilter" permanent redirects on legacy urls (aliases don't match autoroutepart pattern relevant content item).
the filter implements iactionfilter , inherits filterprovider. works fine , when redirect calls following method in onactionexecuting:
filtercontext.httpcontext.response.redirectpermanent(targetpath, true);
according documentation second parameter suggests threadabortexception thrown abort current request. however, request still processed legacy url, know because part drivers still execute both legacy , new urls.
how can abort request filter without orchard continuing execute it?
just worked out. need use instead:
filtercontext.result = new redirectresult(targetpath, true);
i'm guessing can't call redirectpermenant inside filter.
Comments
Post a Comment