Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #212

  • Loading branch information...
commit cf55d984751c63f716037172fad063477e58c18d 1 parent 8a8a660
@milani milani authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/router/Request.js
View
11 lib/router/Request.js
@@ -5,11 +5,20 @@ var ClientRequest = require('http').ClientRequest,
module.exports = Request;
+function objectKeysToLower(obj){
+ for(prop in obj) {
+ if(!obj.hasOwnProperty(prop) || typeof obj[prop] == "function") continue;
+ obj[prop.toLowerCase()] = obj[prop];
+ delete obj[prop];
+ }
+ return obj;
+}
+
function Request(request){
var decodedURL = decodeURIComponent(request.url);
var parsed = url.parse(decodedURL, true);
this.url = decodedURL;
- this.headers = request.headers;
+ this.headers = objectKeysToLower(request.headers);
this.method = request.method.toLowerCase();
this.pathname = parsed.pathname;
this.hash = parsed.hash;
Please sign in to comment.
Something went wrong with that request. Please try again.