Created
March 30, 2012 21:08
-
-
Save kotfic/2255014 to your computer and use it in GitHub Desktop.
Duck punching for fun and profit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone._sync = Backbone.sync; | |
Backbone.sync = function(method, model, options) { | |
options = _.extend( options, { | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader("Authorization", "Basic " + window.btoa( localStorage['assembla_username'] + ":" + localStorage['assembla_password'] ) ); | |
} }); | |
return Backbone._sync( method, model, options ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment