Asp.Net MVC: requests with too long URLs and error handling?

A google search helped me find that some other people get this kind of request. Someone answered with: I am pretty sure it is an automated way of submitting spam. There must be an error in the configuration because it should not leave such a juicy trail in the referrer field!

First it tells some script to get an URL, then it instructs to post to an URL (it is easy to block spam that POSTs directly without getting first) The numbers could be relating to what spam message(s) to post (think of it as indexes in a spam DB) So, since there are good chances that these requests are not from humans following normal links, I ended up with the following solution. This avoids polluting my elmah log and this serves a blank page to the caller with a 404 code: public void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) { HttpException hExc = e.Exception. GetBaseException() as HttpException; if (hExc!

= null) { if (hExc. ErrorCode == unchecked((int)0x80004005)) { e.Dismiss(); return; } } // Here I do some stuff if the error has to be logged. } void Application_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); HttpException hExc = exc as HttpException; if (hExc!

= null) { if (hExc. ErrorCode == unchecked((int)0x80004005)) { Uri uri = HttpContext.Current.Request. Url; Response.Clear(); Response.

StatusCode = 404; Response.End(); Server.ClearError(); } } } Instead of returning a 404 code, I would have preferred to not send a response (the caller would have a timeout) but is it possible with asp. Net? No idea.

A google search helped me find that some other people get this kind of request. Someone answered with: I am pretty sure it is an automated way of submitting spam. There must be an error in the configuration because it should not leave such a juicy trail in the referrer field!

First it tells some script to get an URL, then it instructs to post to an URL (it is easy to block spam that POSTs directly without getting first). The numbers could be relating to what spam message(s) to post (think of it as indexes in a spam DB). So, since there are good chances that these requests are not from humans following normal links, I ended up with the following solution.

This avoids polluting my elmah log and this serves a blank page to the caller with a 404 code: public void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) { HttpException hExc = e.Exception. GetBaseException() as HttpException; if (hExc! = null) { if (hExc.

ErrorCode == unchecked((int)0x80004005)) { e.Dismiss(); return; } } // Here I do some stuff if the error has to be logged. } void Application_Error(object sender, EventArgs e) { Exception exc = Server.GetLastError(); HttpException hExc = exc as HttpException; if (hExc! = null) { if (hExc.

ErrorCode == unchecked((int)0x80004005)) { Uri uri = HttpContext.Current.Request. Url; Response.Clear(); Response. StatusCode = 404; Response.End(); Server.ClearError(); } } } Instead of returning a 404 code, I would have preferred to not send a response (the caller would have a timeout) but is it possible with asp.Net?

No idea...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions