Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request validation problem only for Googlebot

I don't have a lot of hair, but I'm pulling out what little of it is left.

My MVC3 app serves images via Action like so

/Image/ShowImage/25-000252?t=a&o=1

a is predefined image size, o is image order for that item

Image is controller, ShowImage is action which returns FilePathResult. All this works without any problems except when Googlebot comes along. Then all of a sudden request validation kicks in

A potentially dangerous Request.Path value was detected from the client (?).

How and why are both beyond my ability to understand.

ShowImage action has ValidateInput(False), web.config has httpRuntime requestValidationMode="2.0" but nothing seems to help.

like image 309
Vnuk Avatar asked Jun 11 '11 15:06

Vnuk


1 Answers

Turn on tracing for the app or install elmah or look in the logs for iis to see the path that is returning 500 status code. Then it should be clear what needs to change.

like image 149
Adam Tuliper Avatar answered Nov 07 '22 04:11

Adam Tuliper