We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Http response changes between IIS 7 and 10RSS

2 replies

Last post Feb 01, 2021 02:31 AM by Brucz

  • Http response changes between IIS 7 and 10

    Jan 31, 2021 08:23 AM|Robert Simpson|LINK

    Hi All

    In particular, I am interested in if IIS 10.0 (IIS Express 10.0.19041.1 to be exact) would provide a Http Response code of 413, where IIS 7.0 to 8.0 provided 404.13, when the content length was too great.

     

    I am working through a uni assignment for ASP.NET MVC that was designed 5 or 6 years ago. It wants a custom redirect for anything over 20mb upload, and achieves this by adjusting the maxRequestLength and maxAllowedContentLength and catching the response 404.13.

    Same code and same testing conditions, instead gives me back http response 413. Considering 413 is the IANA standard for payload too large, I don't think that in itself is actually a problem, it's just not what I was expecting and I can't find any documentation that would tell me either way.

    Salient details if they help - Visual Studio 2019 Community, .NET 4.7.2, IIS 10.0.19041.1.

    I have as a fix, applied the same custom redirect for 404.13 and 413, hypothesis being that if it is IIS version dependent, this catches both cases, but I don't know enough about the program to be confident in that without guidance. 

    Any help appreciated!

    Rob S

  • Re: Http response changes between IIS 7 and 10

    Jan 31, 2021 06:36 PM|lextm|LINK

    Robert Simpson

    Same code and same testing conditions, instead gives me back http response 413. Considering 413 is the IANA standard for payload too large, I don't think that in itself is actually a problem, it's just not what I was expecting and I can't find any documentation that would tell me either way.

    There are several modules/settings that can affect large payload requests, so you need to run failed request tracing to dig further.

    Lex Li
    Want to have a chat on the issues you meet? Book an appointment at https://buy.stripe.com/cN24ia0yi7sAdIA7sv
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Http response changes between IIS 7 and 10

    Feb 01, 2021 02:31 AM|Brucz|LINK

    Hi Robert Simpson,

    It seems that IIS 7 doesn't define 413 but 404.13. IIS8, IIS10 and IIS7 have not changed much, and seem to use 404.13. However, IIS5 and 6 use 413.

    According to the description of IIS using 413 codes in this answer, it is difficult to understand why IIS does this. But there are also many people who encounter the problem of returning 413 when using IIS10, so it cannot be said that 413 codes are prohibited in IIS10. Documents related to this also appear to have been deleted.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.