Created
September 28, 2015 10:17
-
-
Save smokku/facfbce504300653732c to your computer and use it in GitHub Desktop.
node-proxy capitalize lower case headers
This file contains hidden or 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
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