Skip to main content
MB_arr
Staff
Staff
March 23, 2026

Technical Tip: JavaScript Files Fail to Load with ERR_INCOMPLETE_CHUNKED_ENCODING Due to Chunked Response Handling in FortiWeb

  • March 23, 2026
  • 0 replies
  • 168 views
Description

This article describes a scenario where web applications protected by FortiWeb fail to load JavaScript resources, resulting in browser errors such as ‘ERR_INCOMPLETE_CHUNKED_ENCODING’ or ‘NS_ERROR_NET_PARTIAL_TRANSFER’.

The backend server responds with HTTP 200 using chunked transfer encoding. However, the response may not be fully delivered to the browser when processed by FortiWeb, leading to incomplete content delivery.

Scope FortiWeb.
Solution

FortiWeb’s default HTTP parser size can be too small for certain large, chunked responses. When the response exceeds this limit, FortiWeb truncates the data before forwarding it to the client.

 

  1. Observed Browser Behavior:
  • The website fails to load completely or renders partially.
  • Browser developer tools (from the Network tab) show JavaScript files with partial content delivery.
  • Errors indicate incomplete chunked transfer: 'ERR_INCOMPLETE_CHUNKED_ENCODING’ or ‘NS_ERROR_NET_PARTIAL_TRANSFER’.

 

trunc.png

 

  1. Observed Server-Side Behavior:

  • The backend application returns full HTTP 200 responses using chunked transfer encoding.
  • FortiWeb forwards truncated responses to the web browser when large chunked payloads exceed the internal HTTP parser limit.

 

bckend.png

 

  1. Triggering condition and solution:

  • FortiWeb truncates large, chunked responses when the total parsed size exceeds the http-parse-max-size threshold and chunk-encoding is not explicitly enabled in the server policy.
  • Identify the affected Server Policy and apply the following setting to the policy via CLI.

 

config server-policy policy     edit <policy-name>         set chunk-encoding enable         set http-parse-max-size 2097152     next end

 

The error is cleared after the above configuration is applied to the respective Server Policy.

 

Parameter notes:

  • Chunk-encoding enable: Explicitly enables handling of chunked transfer encoding responses.
  • 'http-parse-max-size': Defines the maximum buffer size for HTTP parsing. The example value of 2097152 bytes (2 MB) accommodates larger JavaScript payloads. Adjust based on application requirements.

 

Related document:

server-policy policy 

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.