viktor-evdokimov / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Disabling input validation on action, which then throws an exception doesn't log #330

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have an MVC3 site with a controller action that has
[ValidateInput(false)]
One of the paramters is an xml string.
When an exception is thrown inside that action, elmah does not log the 
exception.
I tracked it down to the method in Error.cs below throwing an exception about 
"a potentially dangerous request....."
        private static NameValueCollection CopyCollection(NameValueCollection collection)
        {
            if (collection == null || collection.Count == 0)
                return null;

            return new NameValueCollection(collection);
        }

To work around the issue I turned off all input validation for the site.

Original issue reported on code.google.com by twobitb...@gmail.com on 18 Apr 2013 at 3:39

GoogleCodeExporter commented 9 years ago
Er, this should probably be a defect, not an enhancement, but it doesn't look 
like I can change it.

Original comment by twobitb...@gmail.com on 18 Apr 2013 at 3:40

GoogleCodeExporter commented 9 years ago
This issue has been migrated to:
https://github.com/elmah/Elmah/issues/330
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is 
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of 
any further development.

Original comment by azizatif on 25 Aug 2015 at 8:25