Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

split on header since req.host isn't defined yet

  • Loading branch information...
commit 59d198eea8596d1a83cfcfc1f5fa7c6db7dd4a7d 1 parent d970e49
James Halliday authored December 15, 2010

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  lib/servers/http.js
8  lib/servers/http.js
@@ -2,10 +2,10 @@ var http = require('http');
2 2
 
3 3
 module.exports = function (cb) {
4 4
     return http.createServer(function (req, res) {
5  
-        console.log(' *** req ***');
6  
-        console.dir(req);
7  
-        console.log(' *** res ***');
8  
-        console.dir(res);
  5
+        var m = req.headers.host.split(/:/);
  6
+        req.host = m[0];
  7
+        req.port = m[1] || 80;
  8
+        
9 9
         cb(req, res);
10 10
     });
11 11
 };

0 notes on commit 59d198e

Please sign in to comment.
Something went wrong with that request. Please try again.