#47 ✓invalid
Brian Johnson

304 output not compatible with XMLHTTPRequest spec

Reported by Brian Johnson | May 8th, 2009 @ 08:21 PM

This is the relevant section:

The XML response entity body is either a Document representing the response entity body or null. The XML response entity body is the return value of the following algorithm:

  1. If the response entity body is "null" terminate these steps and return null.

  2. If a Content-Type is present and it does not contain a MIME type (ignoring any parameters) that is text/xml, application/xml or ends in +xml terminate these steps and return null. (Do not terminate these steps if there is no Content-Type header at all.)

The problem is that rack_process.rb deletes the content type and sets the output to [] which returns an empty response body. Because it removes the content-type header, XMLHTTPRequest will interpret the response as text/xml. An empty string is not valid XML and will produce a "no element found" error in Firefox. It seems that the finsh/to_a method should set the content type to something like text/plain or return a response body of "null" for 304 status responses.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages