Skip to content

Instantly share code, notes, and snippets.

@quirkey
Created August 27, 2010 23:00
Show Gist options
  • Save quirkey/554343 to your computer and use it in GitHub Desktop.
Save quirkey/554343 to your computer and use it in GitHub Desktop.
var fixHeaders = function(headers) {
var new_headers = {};
for (key in headers) {
var new_key = key.replace(/((^|\-)[a-z])/ig, function($1) {
return $1.toUpperCase();
});
new_headers[new_key] = headers[key];
};
return new_headers;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment