Default Limits for IIS Express

前端 未结 4 660
再見小時候
再見小時候 2020-12-16 16:57

I need to test a file upload component that will be accepting very large files. I want to test locally in my development environment but since I use IIS Express instead of I

4条回答
  •  有刺的猬
    2020-12-16 17:45

    Working to get around the "400 Bad Request" due to request headers that are too big, against the Visual Studio 2019's default IIS Express instance, I couldn't get Sarah's solution to work, but found that the http.sys settings here did the trick.

    Specifically, I created inside HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters a DWORD registry value called MaxRequestBytes and setting it to a large enough value. For me, 33000 was enough. Also created MaxFieldLength in the same place, and set it to 33000. A machine reboot is mandatory for the setting to become effective.

    As for the cause of my problem, it's described here. It's essentially caused by authentication cookies that get placed inside the request headers. Pushing to an Azure App Service works just fine (the limit for the headers there is probably 32KB), but against the local IIS Express, it failed continuously, until the fix described above.

提交回复
热议问题