ASP.NET apps built with HWC buildpack refuses request body larger than 2 MB in Tanzu Application Service for VMs
search cancel

ASP.NET apps built with HWC buildpack refuses request body larger than 2 MB in Tanzu Application Service for VMs

book

Article ID: 298264

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

You are trying to send a request to .NET Framework app built with a HWC buildpack where the request body is larger than 2 MB. However, the app refuses the request with the HTTP status code 413: Request Entity Too Large.

Environment

Product Version: 2.11

Resolution

By default, the HWC buildpack has the default requestLimits configured as follows:
  • maxAllowedContentLength='2097152'
  • maxUrl='260'
  • maxQueryString='2048' 
The HWC buildpack depends web.config file. The request body (content length) is greater than 2097152 bytes, and as a result gets refused.

For your app to support larger request body's, you can modify web.config in your project and add maxAllowedContentLength with a larger value

For example: 
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="<VALUE>" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>