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

Changeset 6557

Show
Ignore:
Timestamp:
04/24/07 03:34:30 (1 year ago)
Author:
sam
Message:

prototype: Don't call evalResponse() when an Ajax response has no Content-type header. Closes #7827.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r6556 r6557  
    11*SVN* 
     2 
     3* Don't call evalResponse() when an Ajax response has no Content-type header.  Closes #7827.  [Tobie Langel] 
    24 
    35* Automatically strip security delimiter comments from JSON strings before evaling them.  The default delimiter is '/*-secure- ... */' or you can specify your own with the Prototype.JSONFilter regular expression.  If you wrap your JSON response bodies in this delimiter on the server side, rogue external sites can't hijack potentially sensitive data via <script> tags.  Closes #7910.  [Tobie Langel] 
  • spinoffs/prototype/trunk/src/ajax.js

    r6556 r6557  
    186186      } 
    187187       
    188       if ((this.getHeader('Content-type') || 'text/javascript').strip(). 
     188      var contentType = this.getHeader('Content-type'); 
     189      if (contentType && contentType.strip(). 
    189190        match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) 
    190191          this.evalResponse();