Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7827 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] evalResponse() is no longer called when no content type header

Reported by: suntoast Assigned to: sam
Priority: high Milestone: 1.x
Component: Prototype Version: edge
Severity: normal Keywords: ajax
Cc:

Description

Version 1.4 -> 1.5 of prototype made a bunch of fixes to Ajax evalResponse and onComplete.

The code changed from:

if ((this.header('Content-type') ).match(/text\/javascript/i))

this.evalResponse();

To

if ((this.getHeader('Content-type') 'text/javascript').strip().

match(/(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))

this.evalResponse();

The bug is that the code changed from using if there was no content type, to using 'text/javascript', which will match on the regExp every time.

There is no option to turn this off.

There are times when it is not possible to set the content-type of the response. In my case, I have an client that works either online or offline. When offline, it uses the file system with fixed files, instead of a web server.

Request reverting back to using instead of 'text/javascript'.

Attachments

autoeval.diff (511 bytes) - added by Tobie on 04/24/07 03:22:22.

Change History

04/24/07 03:22:22 changed by Tobie

  • attachment autoeval.diff added.

04/24/07 03:22:33 changed by Tobie

  • summary changed from evalResponse() is called when no content type header has been set to [PATCH] evalResponse() is no longer called when no content type header.

04/24/07 05:44:23 changed by Tobie

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [6557]