Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a request be handled and ended prematurely, early in the pipeline?

I have an HttpModule that has bound an event handler to EndRequest.

Is there any way to handle the request inside the event handler? Meaning, I don't just want to run code and keep the request moving -- I want to stop it dead in its tracks, return a 200 Status Code, and call it a day, without it request continuing to the next step in the pipeline.

like image 716
Deane Avatar asked Mar 18 '09 05:03

Deane


1 Answers

HttpContext.Current.ApplicationInstance.CompleteRequest();

Documentation

like image 97
Robert C. Barth Avatar answered Sep 23 '22 06:09

Robert C. Barth