Skip to content

Instantly share code, notes, and snippets.

@smokku
Created September 28, 2015 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smokku/facfbce504300653732c to your computer and use it in GitHub Desktop.
Save smokku/facfbce504300653732c to your computer and use it in GitHub Desktop.
node-proxy capitalize lower case headers
var http = require('http');
var setHeader = http.OutgoingMessage.prototype.setHeader;
http.OutgoingMessage.prototype.setHeader = function() {
var match, submatch;
arguments[0] = arguments[0].replace(/\b(\w)/g, function(match, submatch) {
return submatch ? submatch.toUpperCase() : "";
});
setHeader.apply(this, arguments);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment