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

Ticket #6638: conditionally_pass_username_and_password_patch.diff

File conditionally_pass_username_and_password_patch.diff, 0.9 kB (added by jmecham, 2 years ago)
  • prototype.js

    old new  
    780780    try { 
    781781      Ajax.Responders.dispatch('onCreate', this, this.transport); 
    782782 
    783       this.transport.open(this.options.method.toUpperCase(), this.url, 
    784         this.options.asynchronous, this.options.username, 
    785         this.options.password); 
     783      if (this.options.username && this.options.password) { 
     784        this.transport.open(this.options.method.toUpperCase(), this.url, 
     785          this.options.asynchronous, this.options.username, 
     786          this.options.password); 
     787      } else { 
     788        this.transport.open(this.options.method.toUpperCase(), this.url, 
     789          this.options.asynchronous); 
     790      } 
    786791 
    787792      if (this.options.asynchronous) 
    788793        setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10);