IIS 10: ASP.NET Web.config maxRequestLength not enforced

1.5k Views Asked by At

I am developing an ASP.NET web forms application on Windows 10 Pro x64. I believe that its running IIS 10 because my Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\VersionString = Version 10. I checked my Windows features and Internet Information Services/World Wide Web Services/Security/Request Filtering is installed.

I have the following request size limits in my web.config file:

<system.web>
    <httpRuntime requestValidationMode="2.0" maxRequestLength="2048" />
</system.web>

and

<system.webServer>
    <security>
       <requestFiltering>
          <requestLimits maxAllowedContentLength="2048000" />
       </requestFiltering>
     </security>
 </system.webServer>

But, my application still allows me to upload 4MB files. I'm trying to test what happens when the max request size limit is exceeded. But, I can't get IIS to throw an http status 413 exception.

0

There are 0 best solutions below