In asp.net-mvc, will a 404 file request too long not be found as an error?

I have an asp.net-mvc website and I have a case where I have a very long request in the url. This was not a problem before, but I suddenly get this error in several cases:

enter image description here 404-File or director not found - the resource you are looking for may be deleted, its name changed or temporarily unavailable.

I have not proven that it is because of the length of the url, but the reason I believe this is due to the length of the request is that if I chose to delete certain parts of the query string, it works fine, and I went through each section (to identify part of the query string "damaged"

I can reproduce this error in my example with a total URL length of 2805 characters. Is this expected? I see a problem in both Firefox and Internet Explorer.

The reason I'm asking is because from my search query, it looks like IIS is generating another error when the querystring is too long (error 415 or 414 as described here )

Is this something that is set on the server side? in web.config?

+6
source share
3 answers
<system.webServer> <security> <requestFiltering> <requestLimits maxQueryString="xxxx"/> </requestFiltering> </security> </system.webServer> 

Cm

http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits

https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx

+8
source

Per MSDN :

When request filtering blocks an HTTP request because the HTTP request exceeds the limits of the request, IIS 7 returns an HTTP 404 error to the client and logs one of the following HTTP states with a unique sub-item that identifies the reason the request was refused:

 | HTTP | Substatus Description | |---------|---------------------------| | 404.13 | Content Length Too Large | | 404.14 | URL Too Long | | 404.15 | Query String Too Long | 

FYI - 2048 is usually considered the largest cross-browser limit for URL length.

+3
source

IIS seems to issue a non-standard error code 404.15 for very long query strings. This is probably overshadowed by the default error handler, and the actual error maps to error 404.

Read this for details: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits

+2
source

Source: https://habr.com/ru/post/982904/


All Articles