A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
you would need to add some magic in web.config file:
<configuration>
<system.webServer>
<handlers>
<add name="ExternalResourceHandler"
path="/external/*"
verb="GET"
type="{FQN of your HTTP handler type + assembly name}"/>
</handlers>
</system.webServer>
</configuration>
I did try that but it didn't work.
Instead I had to add this:
routes.Add(new Route("external/{guid}", new ExternalRouteHandler()));
public class ExternalRouteHandler: IRouteHandler
{
publicIHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new ExternalHttpHandler();
}
}
public class ExternalHttpHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
//Your ccustom code here
}
}
hm, interesting. my web.config works just fine. are "run managed stuff for all requests" enabled in web.config?
btw, assume that you need to *insert* this route at the beginning and not adding that (as it might be overwritten by some epi "final not found route")?
Yes, runAllManagedModulesForAllRequests is enabled.
I don't follow your meaning with insert and adding. :)
guess for the routing you should be fine with just adding a route. sometimes we noticed that route is added "too late" to the route table resulting in some overwrites and route handler does not have chance to execute anymore.
How do I trigger a HttpHandler on a specific url? For example */external/*
The purpose is for retrieving an external document and stream out to the page.