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

Ticket #7781 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

setRequestHeader crashes due to function type properties

Reported by: segabor Assigned to: sam
Priority: high Milestone:
Component: Prototype Version:
Severity: major Keywords: ajax prototype Ajax.Request function ajaxscaffoldp
Cc:

Description

In function setRequestHeaders of Ajax.Request the iteration of headers array is bogus (at line 876). Calling of this.transport.setRequestHeader(name, headers[name]); will possibly throws exception if type of headers[name] is function.

This issue exists since Prototype release 1.5rc1.

I fixed the iteration with the following condition:

    for (var name in headers) {
        // skip function values
        if (typeof headers[name] != 'function') {
          this.transport.setRequestHeader(name, headers[name]);
        }
    }

Change History

03/20/07 11:47:31 changed by mislav

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

Something extended your Object.prototype, probably Rico or json.js from json.org

Extending Object.prototype is done at your own risk. Prototype will not fix what's not broken

03/20/07 11:49:03 changed by mislav

  • status changed from closed to reopened.
  • resolution deleted.

03/20/07 11:49:16 changed by mislav

  • status changed from reopened to closed.
  • resolution set to duplicate.

see #6579