Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "Chunked body did not terminate properly with 0-sized chunk."?

Tags:

asp.net

iis

rss

I have an RSS feed. When I browse to the feed with Fiddler Web Debugger open, Fiddler throws this error at me:

Chunked body did not terminate properly with 0-sized chunk.

The response from the server that triggered the error looks like this:

HTTP/1.1 200 OK
Date: Tue, 22 Jan 2013 21:00:49 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 30985

<rss version="2.0">
  <channel>
  ... etc

The owner of the RSS is reporting problems when trying to submit the site to RSS aggregators.

I tried to validate the rss here: http://validator.w3.org/appc/. The response was this:

IncompleteRead(30985 bytes read) (IncompleteRead; misconfigured server?)

However, if I browse to the rss and copy past the code into this validator: http://validator.w3.org/appc/#validate_by_input, then everything validates correctly.

How do I correct this? This is a C# ASP.NET webforms project running on .NET 3.5 in IIS6.

Update

It appears that I was using Fiddler incorrectly. After unchcking the Decode option, here is the server response:

HTTP/1.1 200 OK
Date: Tue, 22 Jan 2013 21:22:03 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Transfer-Encoding: chunked
Cache-Control: private
Content-Type: text/xml; charset=utf-8

7909
<rss version="2.0">
  <channel>
   ... etc
like image 640
quakkels Avatar asked Feb 17 '23 18:02

quakkels


1 Answers

The data you posted above is not what the server sent. The response from the server contained a HTTP Header Transfer-Encoding: chunked but your data was not properly in the HTTP-chunked encoding format.

Please update your question with the actual data, as captured by Fiddler, making sure the Decode option in Fiddler's toolbar is NOT checked.

(As to the root cause of the problem, did you mistakenly call Response.Close()? See this article for an explanation of why that's the incorrect way to complete a HTTP response.)

like image 192
EricLaw Avatar answered May 09 '23 22:05

EricLaw